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-08-26 00:09:18 +0200 |
commit | 95efa0b4a5fddd3384ba7bf7f703b3acf5ab44d3 (patch) | |
tree | ba2b8d53611fdae7197f50e6ab60476c1d880d9d /src/scripting/lua.cpp | |
parent | 054891b516cea1b30a19cc9effb44ecbcf74319d (diff) | |
download | manaserv-95efa0b4a5fddd3384ba7bf7f703b3acf5ab44d3.tar.gz manaserv-95efa0b4a5fddd3384ba7bf7f703b3acf5ab44d3.tar.bz2 manaserv-95efa0b4a5fddd3384ba7bf7f703b3acf5ab44d3.tar.xz manaserv-95efa0b4a5fddd3384ba7bf7f703b3acf5ab44d3.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.
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 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; } |