diff options
author | Thorbjørn Lindeijer <thorbjorn@lindeijer.nl> | 2013-04-14 15:10:06 +0200 |
---|---|---|
committer | Thorbjørn Lindeijer <thorbjorn@lindeijer.nl> | 2013-04-14 15:10:06 +0200 |
commit | 080ddbe822b03416934a875b2d949e3afc84fb96 (patch) | |
tree | 8915d1c92fdd0e609952afc492cbc3ea1152d1ae /src/game-server/npc.cpp | |
parent | 3a132996f798dbf552ac858b06fa656b6790a501 (diff) | |
download | manaserv-080ddbe822b03416934a875b2d949e3afc84fb96.tar.gz manaserv-080ddbe822b03416934a875b2d949e3afc84fb96.tar.bz2 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/npc.cpp')
-rw-r--r-- | src/game-server/npc.cpp | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/src/game-server/npc.cpp b/src/game-server/npc.cpp index b5e17eac..980358da 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); |