From b822dcee52d15d41c4186a250e73b85b16c9dc39 Mon Sep 17 00:00:00 2001 From: Thorbjørn Lindeijer Date: Sat, 10 Mar 2012 23:38:36 +0100 Subject: Removed the create_npc wrapper and the last two NPC callbacks When creating an NPC, you now provide its optional talk and update functions directly rather than them being stored in a table on the Lua side and then called in response to a global callback. Also fixed an issue with a missing gender parameter to the delayed NPC creation callback used by NPCs defined on the map (found by Erik while reviewing this patch). Reviewed-by: Erik Schilling --- src/scripting/script.cpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'src/scripting/script.cpp') diff --git a/src/scripting/script.cpp b/src/scripting/script.cpp index 6312d1ce..074546ef 100644 --- a/src/scripting/script.cpp +++ b/src/scripting/script.cpp @@ -111,7 +111,10 @@ bool Script::loadFile(const std::string &name) } } -void Script::loadNPC(const std::string &name, int id, int x, int y, +void Script::loadNPC(const std::string &name, + int id, + ManaServ::BeingGender gender, + int x, int y, const char *prog) { if (!mCreateNpcDelayedCallback.isValid()) @@ -124,6 +127,7 @@ void Script::loadNPC(const std::string &name, int id, int x, int y, prepare(mCreateNpcDelayedCallback); push(name); push(id); + push(gender); push(x); push(y); execute(); -- cgit v1.2.3-60-g2f50