From 602e448c1223a47853522bcd2ef78dc7c25d2b4e Mon Sep 17 00:00:00 2001 From: Yohann Ferreira Date: Fri, 26 Aug 2011 00:09:18 +0200 Subject: Made the npc_create() function use insertion enqueueing. As the server was exitting when the insertion was failing anyway, and because the GameState::update() doesn't allow actor insertion while the update process, it was then pretty weird to not use an enqueued insertion for it. Plus, it fixes an assertion failure when scheduling an npc creation. Resolves: Mana-Mantis #360. Reviewed-by: o11c. --- src/scripting/lua.cpp | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) (limited to 'src/scripting/lua.cpp') diff --git a/src/scripting/lua.cpp b/src/scripting/lua.cpp index 546f4a6..7213bd0 100644 --- a/src/scripting/lua.cpp +++ b/src/scripting/lua.cpp @@ -206,10 +206,7 @@ static int npc_create(lua_State *s) } q->setMap(m); q->setPosition(Point(x, y)); - bool b = GameState::insert(q); - /* Do not try to deal with a failure there. There are some serious issues - if an insertion failed on an almost empty map. */ - assert(b); (void)b; + GameState::enqueueInsert(q); lua_pushlightuserdata(s, q); return 1; } -- cgit