diff options
author | Yohann Ferreira <yohann_dot_ferreira_at_orange_dot_efer> | 2011-08-26 00:09:18 +0200 |
---|---|---|
committer | Yohann Ferreira <yohann_dot_ferreira_at_orange_dot_efer> | 2011-09-28 16:11:16 +0200 |
commit | 602e448c1223a47853522bcd2ef78dc7c25d2b4e (patch) | |
tree | 4d91fc631fed29dbf197e994e133faa74b658403 /src/scripting/lua.cpp | |
parent | 0228543e6602177d933f6c88de56601201a8ab76 (diff) | |
download | manaserv-602e448c1223a47853522bcd2ef78dc7c25d2b4e.tar.gz manaserv-602e448c1223a47853522bcd2ef78dc7c25d2b4e.tar.bz2 manaserv-602e448c1223a47853522bcd2ef78dc7c25d2b4e.tar.xz manaserv-602e448c1223a47853522bcd2ef78dc7c25d2b4e.zip |
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.
Diffstat (limited to 'src/scripting/lua.cpp')
-rw-r--r-- | src/scripting/lua.cpp | 5 |
1 files changed, 1 insertions, 4 deletions
diff --git a/src/scripting/lua.cpp b/src/scripting/lua.cpp index 546f4a66..7213bd09 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; } |