diff options
author | Ľubomír Remák | 2018-07-21 15:17:17 +0200 |
---|---|---|
committer | Eugene Sandulenko | 2018-08-25 23:12:01 +0200 |
commit | 6c4ae7f19883dd7fa6de4fc3234351f1e33ba7a3 (patch) | |
tree | 76ac2bd31d15cb278162d803a1403388abafc6a5 /engines/mutationofjb/commands | |
parent | 215b87ccca4c4888cd70c990271fe62177d054f0 (diff) | |
download | scummvm-rg350-6c4ae7f19883dd7fa6de4fc3234351f1e33ba7a3.tar.gz scummvm-rg350-6c4ae7f19883dd7fa6de4fc3234351f1e33ba7a3.tar.bz2 scummvm-rg350-6c4ae7f19883dd7fa6de4fc3234351f1e33ba7a3.zip |
MUTATIONOFJB: Implement multiple speeches in one response line.
Diffstat (limited to 'engines/mutationofjb/commands')
-rw-r--r-- | engines/mutationofjb/commands/talkcommand.cpp | 5 | ||||
-rw-r--r-- | engines/mutationofjb/commands/talkcommand.h | 5 |
2 files changed, 5 insertions, 5 deletions
diff --git a/engines/mutationofjb/commands/talkcommand.cpp b/engines/mutationofjb/commands/talkcommand.cpp index 18ce956696..8411e9080a 100644 --- a/engines/mutationofjb/commands/talkcommand.cpp +++ b/engines/mutationofjb/commands/talkcommand.cpp @@ -56,14 +56,13 @@ bool TalkCommandParser::parse(const Common::String &line, ScriptParseContext &, Command::ExecuteResult TalkCommand::execute(ScriptExecutionContext &scriptExeCtx) { if (!_task) { - _task = new ConversationTask(scriptExeCtx.getGameData()._currentScene, scriptExeCtx.getGame().getGameData()._conversationInfo); + _task = TaskPtr(new ConversationTask(scriptExeCtx.getGameData()._currentScene, scriptExeCtx.getGame().getGameData()._conversationInfo, _mode)); scriptExeCtx.getGame().getTaskManager().addTask(_task); } if (_task->getState() == Task::FINISHED) { scriptExeCtx.getGame().getTaskManager().removeTask(_task); - delete _task; - _task = nullptr; + _task.reset(); return Command::Finished; } diff --git a/engines/mutationofjb/commands/talkcommand.h b/engines/mutationofjb/commands/talkcommand.h index 09424b2f06..15b185c613 100644 --- a/engines/mutationofjb/commands/talkcommand.h +++ b/engines/mutationofjb/commands/talkcommand.h @@ -25,6 +25,7 @@ #include "mutationofjb/commands/seqcommand.h" #include "common/scummsys.h" +#include "mutationofjb/tasks/task.h" namespace MutationOfJB { @@ -43,13 +44,13 @@ public: CARNIVAL_TICKET_SELLER_MODE }; - TalkCommand(Mode mode) : _mode(mode), _task(nullptr) {} + TalkCommand(Mode mode) : _mode(mode) {} virtual ExecuteResult execute(ScriptExecutionContext &scriptExecCtx) override; virtual Common::String debugString() const; private: Mode _mode; - ConversationTask *_task; + TaskPtr _task; }; } |