Reset ClrMod when SetClrModulation is called without argument

scancodes-fix
Armin Burgmeier 2009-09-19 16:38:19 -04:00
parent e762a4501e
commit c0bf72c663
1 changed files with 6 additions and 3 deletions

View File

@ -3397,8 +3397,11 @@ static C4Value FnSetLength(C4AulContext *cthr, C4Value *pPars)
return C4VBool(true);
}
static bool FnSetClrModulation(C4AulObjectContext *cthr, long dwClr, long iOverlayID)
static bool FnSetClrModulation(C4AulObjectContext *cthr, Nillable<long> dwClr, long iOverlayID)
{
uint32_t clr = 0xffffffff;
if(!dwClr.IsNil()) clr = dwClr;
// overlay?
if (iOverlayID)
{
@ -3408,12 +3411,12 @@ static bool FnSetClrModulation(C4AulObjectContext *cthr, long dwClr, long iOverl
DebugLogF("SetClrModulation: Overlay %d not defined for object %d (%s)", (int) iOverlayID, (int) cthr->Obj->Number, cthr->Obj->GetName());
return false;
}
pOverlay->SetClrModulation(dwClr);
pOverlay->SetClrModulation(clr);
}
else
{
// set it
cthr->Obj->ColorMod=dwClr;
cthr->Obj->ColorMod=clr;
}
// success
return true;