Fix b3fd7879
: Ignore command flags when verifying script commands
Multiplayer games has the server add some flags to the cmd value during the handling. These flags should not be included in the verification, mask them out. Without this masking out, scripts tend to die when executing their first command in multiplayer.
This commit is contained in:
@@ -684,7 +684,10 @@ bool ScriptInstance::DoCommandCallback(const CommandCost &result, TileIndex tile
|
||||
{
|
||||
ScriptObject::ActiveInstance active(this);
|
||||
|
||||
if (!ScriptObject::CheckLastCommand(tile, p1, p2, cmd)) return false;
|
||||
if (!ScriptObject::CheckLastCommand(tile, p1, p2, cmd)) {
|
||||
DEBUG(script, 1, "DoCommandCallback terminating a script, last command does not match expected command");
|
||||
return false;
|
||||
}
|
||||
|
||||
ScriptObject::SetLastCommandRes(result.Succeeded());
|
||||
|
||||
|
Reference in New Issue
Block a user