Pass previous ActionTarget/ActionTarget2 to AbortCalls

stable-5.1
Sven Eberhardt 2010-07-30 19:42:54 +02:00
parent 8b8c7080c2
commit 6512340382
3 changed files with 7 additions and 3 deletions

View File

@ -117,7 +117,7 @@ oben gez
<row>
<col>AbortCall</col>
<col>Zeichenfolge (max. 30)</col>
<col>Wird aufgerufen, wenn die Aktivität vor ihrem Ende durch eine andere ersetzt wird.</col>
<col>Wird aufgerufen, wenn die Aktivität vor ihrem Ende durch eine andere ersetzt wird. Parameter sind letzte Animationsphase, letztes ActionTarget und ActionTarget2.</col>
</row>
<row>
<col>InLiquidAction</col>

View File

@ -3354,6 +3354,8 @@ bool C4Object::SetAction(C4PropList * Act, C4Object *pTarget, C4Object *pTarget2
{
C4PropList * LastAction = GetAction();
int32_t iLastPhase=Action.Phase;
C4Object *pLastTarget = Action.Target;
C4Object *pLastTarget2 = Action.Target2;
// No other action
if (LastAction)
if (LastAction->GetPropertyInt(P_NoOtherAction) && !fForce)
@ -3430,7 +3432,9 @@ bool C4Object::SetAction(C4PropList * Act, C4Object *pTarget, C4Object *pTarget2
if (LastAction->GetPropertyStr(P_AbortCall))
{
C4Def *pOldDef = Def;
Call(LastAction->GetPropertyStr(P_AbortCall)->GetCStr(), &C4AulParSet(C4VInt(iLastPhase)));
if (pLastTarget && !pLastTarget->Status) pLastTarget = NULL;
if (pLastTarget2 && !pLastTarget2->Status) pLastTarget2 = NULL;
Call(LastAction->GetPropertyStr(P_AbortCall)->GetCStr(), &C4AulParSet(C4VInt(iLastPhase), C4VObj(pLastTarget), C4VObj(pLastTarget2)));
// abort exeution if def changed
if (Def != pOldDef || !Status) return true;
}

View File

@ -187,7 +187,7 @@ bool C4GraphicsResource::Init()
}
Game.SetInitProgress(11.0f);
ProgressStart = 12; ProgressIncrement = 0.4;
ProgressStart = 12.0f; ProgressIncrement = 0.4f;
// The progress bar is the only graphic besides the background that is
// used during startup, so load it early
if (!LoadFile(fctProgressBar, "GUIProgress", Files)) return false;