From 95efa0b4a5fddd3384ba7bf7f703b3acf5ab44d3 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. --- 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 91cf7635..75a8ca2c 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 v1.2.3-70-g09d2