summaryrefslogtreecommitdiff
path: root/src/game-server/item.cpp
diff options
context:
space:
mode:
authorErik Schilling <ablu.erikschilling@googlemail.com>2013-02-20 22:46:55 +0100
committerErik Schilling <ablu.erikschilling@googlemail.com>2013-02-21 07:29:13 +0100
commit4559ca444daacfd02ebb05f1657148a2b4cf3d8b (patch)
tree8410fe19f397e70d43a8542c6ba7339d61d9bc0e /src/game-server/item.cpp
parentad1d58b795681cad74642c0f4818b66a3f869794 (diff)
downloadmanaserv-4559ca444daacfd02ebb05f1657148a2b4cf3d8b.tar.gz
manaserv-4559ca444daacfd02ebb05f1657148a2b4cf3d8b.tar.bz2
manaserv-4559ca444daacfd02ebb05f1657148a2b4cf3d8b.tar.xz
manaserv-4559ca444daacfd02ebb05f1657148a2b4cf3d8b.zip
Introduced Script::Context
This should allow to finally call functions to lua without having to care about working around situations where a lua call causes a c++ call which needs to call to lua again. Tested against the source of tales repository data.
Diffstat (limited to 'src/game-server/item.cpp')
-rw-r--r--src/game-server/item.cpp7
1 files changed, 3 insertions, 4 deletions
diff --git a/src/game-server/item.cpp b/src/game-server/item.cpp
index d568fb29..c6c9d11c 100644
--- a/src/game-server/item.cpp
+++ b/src/game-server/item.cpp
@@ -71,11 +71,11 @@ bool ItemEffectScript::apply(Being *itemUser)
if (function.isValid())
{
Script *script = ScriptManager::currentState();
- script->setMap(itemUser->getMap());
script->prepare(function);
script->push(itemUser);
script->push(mItemClass->getDatabaseID());
- script->execute(); // TODO return depending on script execution success.
+ script->execute(itemUser->getMap());
+ // TODO return depending on script execution success.
return true;
}
return false;
@@ -90,11 +90,10 @@ void ItemEffectScript::dispell(Being *itemUser)
if (function.isValid())
{
Script *script = ScriptManager::currentState();
- script->setMap(itemUser->getMap());
script->prepare(function);
script->push(itemUser);
script->push(mItemClass->getDatabaseID());
- script->execute();
+ script->execute(itemUser->getMap());
}
}