diff options
author | Guillaume Melquiond <guillaume.melquiond@gmail.com> | 2007-09-23 12:55:09 +0000 |
---|---|---|
committer | Guillaume Melquiond <guillaume.melquiond@gmail.com> | 2007-09-23 12:55:09 +0000 |
commit | 5618f4890df5eb9ea91eb73a7a7dd7df745863a6 (patch) | |
tree | 07873952b5f3f7efae06b3045692e2d90bd45a58 /src/scripting/lua.cpp | |
parent | 203ed8e40105c17d300b12ee461327cb4416acf2 (diff) | |
download | manaserv-5618f4890df5eb9ea91eb73a7a7dd7df745863a6.tar.gz manaserv-5618f4890df5eb9ea91eb73a7a7dd7df745863a6.tar.bz2 manaserv-5618f4890df5eb9ea91eb73a7a7dd7df745863a6.tar.xz manaserv-5618f4890df5eb9ea91eb73a7a7dd7df745863a6.zip |
Robustified code with respect to insertion failures.
Diffstat (limited to 'src/scripting/lua.cpp')
-rw-r--r-- | src/scripting/lua.cpp | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/src/scripting/lua.cpp b/src/scripting/lua.cpp index f33393a5..048bc6f0 100644 --- a/src/scripting/lua.cpp +++ b/src/scripting/lua.cpp @@ -178,7 +178,10 @@ static int LuaNpc_Create(lua_State *s) } q->setMap(m); q->setPosition(Point(lua_tointeger(s, 2), lua_tointeger(s, 3))); - GameState::insert(q); + 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; lua_pushlightuserdata(s, q); return 1; } |