diff options
author | dolorous <dolorous@c06c8d41-db1a-0410-9941-cceddc491573> | 2008-10-05 16:57:06 +0000 |
---|---|---|
committer | dolorous <dolorous@c06c8d41-db1a-0410-9941-cceddc491573> | 2008-10-05 16:57:06 +0000 |
commit | 341e6e03d6347b96c54d6a295c81070d13ea9152 (patch) | |
tree | a3ae8acf43aef5d54ca2ac697636a75af34a3497 /crawl-ref/source/monplace.cc | |
parent | 90451abc4f59c5b9ddad812d08ba2355da07213f (diff) | |
download | crawl-ref-341e6e03d6347b96c54d6a295c81070d13ea9152.tar.gz crawl-ref-341e6e03d6347b96c54d6a295c81070d13ea9152.zip |
Add still more miscellaneous minor fixes.
git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@7139 c06c8d41-db1a-0410-9941-cceddc491573
Diffstat (limited to 'crawl-ref/source/monplace.cc')
-rw-r--r-- | crawl-ref/source/monplace.cc | 27 |
1 files changed, 14 insertions, 13 deletions
diff --git a/crawl-ref/source/monplace.cc b/crawl-ref/source/monplace.cc index a60c628957..5070f80348 100644 --- a/crawl-ref/source/monplace.cc +++ b/crawl-ref/source/monplace.cc @@ -89,10 +89,10 @@ bool monster_habitable_grid(const monsters *m, dungeon_feature_type actual_grid) { // Zombified monsters enjoy the same habitat as their original. - const int type = mons_is_zombified(m) ? mons_zombie_base(m) - : m->type; + const int montype = mons_is_zombified(m) ? mons_zombie_base(m) + : m->type; - return (monster_habitable_grid(type, actual_grid, mons_flies(m), + return (monster_habitable_grid(montype, actual_grid, mons_flies(m), mons_cannot_move(m))); } @@ -550,10 +550,10 @@ static bool _valid_monster_location(const mgen_data &mg, const coord_def &mg_pos, bool force_location) { - const int htype = (mons_class_is_zombified(mg.cls) ? mg.base_type - : mg.cls); + const int montype = (mons_class_is_zombified(mg.cls) ? mg.base_type + : mg.cls); dungeon_feature_type grid_wanted = - habitat2grid(mons_habitat_by_type(htype)); + habitat2grid(mons_habitat_by_type(montype)); if (!in_bounds(mg_pos)) return (false); @@ -824,15 +824,15 @@ static int _place_monster_aux( const mgen_data &mg, menv[id].reset(); - const int htype = (mons_class_is_zombified(mg.cls) ? mg.base_type - : mg.cls); + const int montype = (mons_class_is_zombified(mg.cls) ? mg.base_type + : mg.cls); // Setup habitat and placement. // If the space is occupied, try some neighbouring square instead. if (first_band_member && in_bounds(mg.pos) && (mg.behaviour == BEH_FRIENDLY || !is_sanctuary(mg.pos)) && mgrd(mg.pos) == NON_MONSTER && mg.pos != you.pos() - && (force_pos || monster_habitable_grid(htype, grd(mg.pos)))) + && (force_pos || monster_habitable_grid(montype, grd(mg.pos)))) { fpos = mg.pos; } @@ -2123,17 +2123,18 @@ bool player_angers_monster(monsters *mon) int create_monster( mgen_data mg, bool fail_msg ) { + const int montype = (mons_class_is_zombified(mg.cls) ? mg.base_type + : mg.cls); + int summd = -1; - int type = (mons_class_is_zombified(mg.cls) ? mg.base_type - : mg.cls); if (!mg.force_place() || !in_bounds(mg.pos) || mgrd(mg.pos) != NON_MONSTER || mg.pos == you.pos() - || !mons_class_can_pass(type, grd(mg.pos))) + || !mons_class_can_pass(montype, grd(mg.pos))) { - mg.pos = find_newmons_square(type, mg.pos); + mg.pos = find_newmons_square(montype, mg.pos); } if (in_bounds(mg.pos)) |