Action: Keep a reference on the last action in SetAction

Otherwise, the last action could be destroyed before the end of the
function when it wasn't in the ActMap anymore.
Günther Brammer 2010-12-12 21:12:04 +01:00
parent 0b746f756a
commit c7319206f2
1 changed files with 3 additions and 1 deletions

View File

@ -3336,7 +3336,9 @@ C4PropList* C4Object::GetAction()
bool C4Object::SetAction(C4PropList * Act, C4Object *pTarget, C4Object *pTarget2, int32_t iCalls, bool fForce)
{
C4PropList * LastAction = GetAction();
C4Value vLastAction;
GetProperty(P_Action, &vLastAction);
C4PropList * LastAction = vLastAction.getPropList();
int32_t iLastPhase=Action.Phase;
C4Object *pLastTarget = Action.Target;
C4Object *pLastTarget2 = Action.Target2;