summaryrefslogtreecommitdiffstats
path: root/src/game-server
diff options
context:
space:
mode:
authorThorbjørn Lindeijer <thorbjorn@lindeijer.nl>2013-04-14 15:10:06 +0200
committerThorbjørn Lindeijer <thorbjorn@lindeijer.nl>2013-04-14 15:10:06 +0200
commit080ddbe822b03416934a875b2d949e3afc84fb96 (patch)
tree8915d1c92fdd0e609952afc492cbc3ea1152d1ae /src/game-server
parent3a132996f798dbf552ac858b06fa656b6790a501 (diff)
downloadmanaserv-080ddbe822b03416934a875b2d949e3afc84fb96.tar.gz
manaserv-080ddbe822b03416934a875b2d949e3afc84fb96.tar.xz
manaserv-080ddbe822b03416934a875b2d949e3afc84fb96.zip
Removed NPC and character parameters from NPC functions
These functions can only be used in the context of a character talking to an NPC, so these parameters can be deduced from that context rather than passing them explicitly all the time. Simplifies NPC scripting.
Diffstat (limited to 'src/game-server')
-rw-r--r--src/game-server/npc.cpp2
1 files changed, 2 insertions, 0 deletions
diff --git a/src/game-server/npc.cpp b/src/game-server/npc.cpp
index b5e17ea..980358d 100644
--- a/src/game-server/npc.cpp
+++ b/src/game-server/npc.cpp
@@ -94,6 +94,8 @@ void Npc::start(Entity *npc, Entity *ch)
{
Script::Thread *thread = script->newThread();
thread->getContext().map = npc->getMap();
+ thread->getContext().npc = npc;
+ thread->getContext().character = ch;
script->prepare(talkCallback);
script->push(npc);
script->push(ch);