Make Activate instruction work properly even when onActivate was not called in the same frame.

There are two major differences to the old implementation:
 - Activate can now be called on its own, e.g. in the console. In Vanilla this appears to be a no-op, so it is unlikely to be used and the potential for breakage is low.
 - The Action to execute is now determined when Activate is called, not when OnActivate is called. This however makes sense, since there may be a time difference between the two, and the object (or the player) could have changed in the meantime, requiring a different Action.

Fixes #1166 and #1346.
This commit is contained in:
scrawl 2014-05-28 19:23:50 +02:00
parent 42ea43c3d1
commit e68600eda2
7 changed files with 23 additions and 24 deletions

View file

@ -224,7 +224,7 @@ namespace Compiler
{
extensions.registerFunction ("xbox", 'l', "", opcodeXBox);
extensions.registerFunction ("onactivate", 'l', "", opcodeOnActivate);
extensions.registerInstruction ("activate", "", opcodeActivate);
extensions.registerInstruction ("activate", "", opcodeActivate, opcodeActivateExplicit);
extensions.registerInstruction ("lock", "/l", opcodeLock, opcodeLockExplicit);
extensions.registerInstruction ("unlock", "", opcodeUnlock, opcodeUnlockExplicit);
extensions.registerInstruction ("cast", "SS", opcodeCast, opcodeCastExplicit);