diff --git a/engines/parallaction/commands.cpp b/engines/parallaction/commands.cpp index 095816d3b7c..66e60c16e88 100644 --- a/engines/parallaction/commands.cpp +++ b/engines/parallaction/commands.cpp @@ -199,10 +199,7 @@ void Parallaction::freeCommands(Command *list) { while (cmd) { Command *v4 = (Command*)cmd->_next; - - if (cmd->_id == CMD_LOCATION) free(cmd->u._string); delete cmd; - cmd = v4; } @@ -348,6 +345,18 @@ void Parallaction::runCommands(Command *list, Zone *z) { } +Command::Command() { + _id = 0; + _flagsOn = 0; + _flagsOff = 0; +} + +Command::~Command() { + + if (_id == CMD_LOCATION) free(u._string); + +} + } // namespace Parallaction diff --git a/engines/parallaction/commands.h b/engines/parallaction/commands.h index 5070aef2e9d..1278cdcc9b2 100644 --- a/engines/parallaction/commands.h +++ b/engines/parallaction/commands.h @@ -68,15 +68,8 @@ struct Command : public Node { uint32 _flagsOn; uint32 _flagsOff; - Command() { - _id = 0; - _flagsOn = 0; - _flagsOff = 0; - } - - ~Command() { - - } + Command(); + ~Command(); }; } // namespace Parallaction