From aa04597c5f8bb806996d604699fc8ebff6d53bdd Mon Sep 17 00:00:00 2001 From: Erik Schilling Date: Sat, 6 Apr 2013 21:36:50 +0200 Subject: Converted the Character class into a component A CharacterData was created as a proxy class in order to allow using the old serialization method. --- src/scripting/luascript.cpp | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) (limited to 'src/scripting/luascript.cpp') diff --git a/src/scripting/luascript.cpp b/src/scripting/luascript.cpp index e9f4492..328ae8c 100644 --- a/src/scripting/luascript.cpp +++ b/src/scripting/luascript.cpp @@ -275,35 +275,37 @@ void LuaScript::processRemoveEvent(Entity *entity) /** * Called when the server has recovered the value of a quest variable. */ -void LuaScript::getQuestCallback(Character *q, +void LuaScript::getQuestCallback(Being *q, const std::string &value, Script *script) { - Script::Thread *thread = q->getNpcThread(); + auto *characterComponent = q->getComponent(); + Script::Thread *thread = characterComponent->getNpcThread(); if (!thread || thread->mState != Script::ThreadExpectingString) return; script->prepareResume(thread); script->push(value); - q->resumeNpcThread(); + characterComponent->resumeNpcThread(); } /** * Called when the server has recovered the post for a user. */ -void LuaScript::getPostCallback(Character *q, +void LuaScript::getPostCallback(Being *q, const std::string &sender, const std::string &letter, Script *script) { - Script::Thread *thread = q->getNpcThread(); + auto *characterComponent = q->getComponent(); + Script::Thread *thread = characterComponent->getNpcThread(); if (!thread || thread->mState != Script::ThreadExpectingTwoStrings) return; script->prepareResume(thread); script->push(sender); script->push(letter); - q->resumeNpcThread(); + characterComponent->resumeNpcThread(); } -- cgit