diff options
author | Adam Borowski <kilobyte@angband.pl> | 2013-04-24 15:03:45 +0200 |
---|---|---|
committer | Adam Borowski <kilobyte@angband.pl> | 2013-04-26 17:03:16 +0200 |
commit | 5f493bf4362078a61db8c6a62e16e1faa9a586fe (patch) | |
tree | 42867673f5c01e4c751c63f9a9179976845b5b3f /crawl-ref/source/l_dgnmon.cc | |
parent | 4d69c10402ccda47deefc8ed3482d9764688dc13 (diff) | |
download | crawl-ref-5f493bf4362078a61db8c6a62e16e1faa9a586fe.tar.gz crawl-ref-5f493bf4362078a61db8c6a62e16e1faa9a586fe.zip |
Fix a monster_type misbuild with clang-3.3.
Again, a magic value of -1. It was also wrongly checked in a few error
handling routines, rendering them inoperative even with gcc.
Diffstat (limited to 'crawl-ref/source/l_dgnmon.cc')
-rw-r--r-- | crawl-ref/source/l_dgnmon.cc | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/crawl-ref/source/l_dgnmon.cc b/crawl-ref/source/l_dgnmon.cc index 46a6ae5a92..d6296ad70d 100644 --- a/crawl-ref/source/l_dgnmon.cc +++ b/crawl-ref/source/l_dgnmon.cc @@ -130,8 +130,10 @@ static int dgn_set_random_mon_list(lua_State *ls) luaL_argerror(ls, list_pos, err.c_str()); return 0; } - if (mon.type == -1) +#if TAG_MAJOR_VERSION == 34 + if ((int)mon.type == -1) mon.type = MONS_PROGRAM_BUG; +#endif if (mon.type == MONS_NO_MONSTER) name = "nothing"; else @@ -180,7 +182,7 @@ static int dgn_mons_from_mid(lua_State *ls) monster* mons = monster_by_mid(mid); - if (mons->type != -1) + if (mons->type != MONS_NO_MONSTER) push_monster(ls, mons); else lua_pushnil(ls); |