summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--crawl-ref/source/Kills.cc2
-rw-r--r--crawl-ref/source/dungeon.cc3
-rw-r--r--crawl-ref/source/mon-util.cc4
-rw-r--r--crawl-ref/source/monplace.cc34
4 files changed, 22 insertions, 21 deletions
diff --git a/crawl-ref/source/Kills.cc b/crawl-ref/source/Kills.cc
index b40e6b3a39..bc61b59af5 100644
--- a/crawl-ref/source/Kills.cc
+++ b/crawl-ref/source/Kills.cc
@@ -846,7 +846,7 @@ static int kill_lualc_symbol(lua_State *ls)
case kill_monster_desc::M_ZOMBIE:
case kill_monster_desc::M_SKELETON:
case kill_monster_desc::M_SIMULACRUM:
- ch = mons_zombie_size(ke->monnum) == Z_SMALL? 'z' : 'Z';
+ ch = mons_zombie_size(ke->monnum) == Z_SMALL ? 'z' : 'Z';
break;
case kill_monster_desc::M_SPECTRE:
ch = 'W';
diff --git a/crawl-ref/source/dungeon.cc b/crawl-ref/source/dungeon.cc
index 8bef417413..cfba2e8b16 100644
--- a/crawl-ref/source/dungeon.cc
+++ b/crawl-ref/source/dungeon.cc
@@ -4607,9 +4607,8 @@ int dgn_place_monster(mons_spec &mspec,
int tries = 100;
do
- {
mg.cls = pick_random_monster(mspec.place, lev, lev);
- } while (mg.cls != MONS_PROGRAM_BUG
+ while (mg.cls != MONS_PROGRAM_BUG
&& mons_class_is_zombified(mspec.monbase)
&& !mons_zombie_size(mg.cls)
&& tries-- > 0);
diff --git a/crawl-ref/source/mon-util.cc b/crawl-ref/source/mon-util.cc
index 9ba6c775c5..52036621cb 100644
--- a/crawl-ref/source/mon-util.cc
+++ b/crawl-ref/source/mon-util.cc
@@ -3649,13 +3649,13 @@ int monsters::body_weight() const
{
int mclass = type;
- switch(mclass)
+ switch (mclass)
{
case MONS_SPECTRAL_THING:
case MONS_SPECTRAL_WARRIOR:
case MONS_ELECTRIC_GOLEM:
case MONS_RAKSHASA_FAKE:
- return 0;
+ return (0);
case MONS_ZOMBIE_SMALL:
case MONS_ZOMBIE_LARGE:
diff --git a/crawl-ref/source/monplace.cc b/crawl-ref/source/monplace.cc
index 7e7ce4e85f..f451f59b62 100644
--- a/crawl-ref/source/monplace.cc
+++ b/crawl-ref/source/monplace.cc
@@ -1228,15 +1228,15 @@ static monster_type _pick_random_zombie()
zombifiable.push_back(mcls);
}
}
- return (zombifiable[ random2(zombifiable.size()) ]);
+ return (zombifiable[random2(zombifiable.size())]);
}
-static void _define_zombie( int mid, monster_type ztype,
- monster_type cs, int power, coord_def pos )
+static void _define_zombie(int mid, monster_type ztype, monster_type cs,
+ int power, coord_def pos)
{
- monster_type cls = MONS_PROGRAM_BUG;
- monster_type mons_sec2 = MONS_PROGRAM_BUG;
- int zombie_size = 0;
+ monster_type cls = MONS_PROGRAM_BUG;
+ monster_type mons_sec2 = MONS_PROGRAM_BUG;
+ zombie_size_type zombie_size = Z_NOZOMBIE;
bool ignore_rarity = false;
if (power > 27)
@@ -1258,7 +1258,6 @@ static void _define_zombie( int mid, monster_type ztype,
break;
case MONS_SPECTRAL_THING:
- zombie_size = -1;
break;
default:
@@ -1294,14 +1293,14 @@ static void _define_zombie( int mid, monster_type ztype,
// such as the Temple, HoB, and Slime Pits.
if (you.level_type != LEVEL_DUNGEON
|| player_in_hell()
- || player_in_branch( BRANCH_HALL_OF_ZOT )
- || player_in_branch( BRANCH_VESTIBULE_OF_HELL )
- || player_in_branch( BRANCH_ECUMENICAL_TEMPLE )
- || player_in_branch( BRANCH_CRYPT )
- || player_in_branch( BRANCH_TOMB )
- || player_in_branch( BRANCH_HALL_OF_BLADES )
- || player_in_branch( BRANCH_SNAKE_PIT )
- || player_in_branch( BRANCH_SLIME_PITS )
+ || player_in_branch(BRANCH_HALL_OF_ZOT)
+ || player_in_branch(BRANCH_VESTIBULE_OF_HELL)
+ || player_in_branch(BRANCH_ECUMENICAL_TEMPLE)
+ || player_in_branch(BRANCH_CRYPT)
+ || player_in_branch(BRANCH_TOMB)
+ || player_in_branch(BRANCH_HALL_OF_BLADES)
+ || player_in_branch(BRANCH_SNAKE_PIT)
+ || player_in_branch(BRANCH_SLIME_PITS)
|| one_chance_in(1000))
{
ignore_rarity = true;
@@ -1320,8 +1319,11 @@ static void _define_zombie( int mid, monster_type ztype,
// Size must match, but you can make a spectral thing out
// of anything.
- if (zombie_size != -1 && mons_zombie_size(cls) != zombie_size)
+ if (cs != MONS_SPECTRAL_THING
+ && mons_zombie_size(cls) != zombie_size)
+ {
continue;
+ }
if (cs == MONS_SKELETON_SMALL || cs == MONS_SIMULACRUM_SMALL)
{