summaryrefslogtreecommitdiffstats
path: root/src/game-server/mapcomposite.cpp
diff options
context:
space:
mode:
authorThorbjørn Lindeijer <thorbjorn@lindeijer.nl>2012-03-10 23:38:36 +0100
committerThorbjørn Lindeijer <thorbjorn@lindeijer.nl>2012-03-11 16:56:56 +0100
commitb822dcee52d15d41c4186a250e73b85b16c9dc39 (patch)
tree45515c75175b67fe458701f3a70bf0ee8b14bee5 /src/game-server/mapcomposite.cpp
parent2dd3c5c06978584e3e076609554f225ffbabd3e2 (diff)
downloadmanaserv-b822dcee52d15d41c4186a250e73b85b16c9dc39.tar.gz
manaserv-b822dcee52d15d41c4186a250e73b85b16c9dc39.tar.xz
manaserv-b822dcee52d15d41c4186a250e73b85b16c9dc39.zip
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
Diffstat (limited to 'src/game-server/mapcomposite.cpp')
-rw-r--r--src/game-server/mapcomposite.cpp2
1 files changed, 2 insertions, 0 deletions
diff --git a/src/game-server/mapcomposite.cpp b/src/game-server/mapcomposite.cpp
index a0d48f5..6b2b74f 100644
--- a/src/game-server/mapcomposite.cpp
+++ b/src/game-server/mapcomposite.cpp
@@ -769,12 +769,14 @@ void MapComposite::initializeContent()
else if (utils::compareStrI(type, "NPC") == 0)
{
int npcId = utils::stringToInt(object->getProperty("NPC_ID"));
+ std::string gender = object->getProperty("GENDER");
std::string scriptText = object->getProperty("SCRIPT");
if (npcId && !scriptText.empty())
{
Script *script = ScriptManager::currentState();
script->loadNPC(object->getName(), npcId,
+ ManaServ::getGender(gender),
object->getX(), object->getY(),
scriptText.c_str());
}