From 23dc8538c3995debab6c96f7a56a50266ca96930 Mon Sep 17 00:00:00 2001 From: dolorous Date: Mon, 16 Jun 2008 16:31:01 +0000 Subject: Make -raise_corpse() and animate_a_corpse() use coord_defs instead of x and y coordinates. git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@5882 c06c8d41-db1a-0410-9941-cceddc491573 --- crawl-ref/source/spells3.cc | 19 +++++++++---------- 1 file changed, 9 insertions(+), 10 deletions(-) (limited to 'crawl-ref/source/spells3.cc') diff --git a/crawl-ref/source/spells3.cc b/crawl-ref/source/spells3.cc index 94ee3c6755..6f253178e9 100644 --- a/crawl-ref/source/spells3.cc +++ b/crawl-ref/source/spells3.cc @@ -805,7 +805,7 @@ static void _equip_undead(int x, int y, int corps, int monster, int monnum) #endif } -static bool _raise_corpse(int x, int y, int corps, beh_type beha, +static bool _raise_corpse(const coord_def &a, int corps, beh_type beha, unsigned short hitting, god_type god, bool actual) { const item_def& item = mitm[corps]; @@ -841,7 +841,7 @@ static bool _raise_corpse(int x, int y, int corps, beh_type beha, const int monster = create_monster( mgen_data(mon, beha, 0, - coord_def(x, y), hitting, + a, hitting, 0, god, zombie_type, number)); @@ -859,7 +859,7 @@ static bool _raise_corpse(int x, int y, int corps, beh_type beha, menv[monster].mname = "Blork"; } - _equip_undead(x, y, corps, monster, monnum); + _equip_undead(a.x, a.y, corps, monster, monnum); destroy_item(corps); @@ -869,7 +869,7 @@ static bool _raise_corpse(int x, int y, int corps, beh_type beha, return (false); } -bool animate_a_corpse(int x, int y, corpse_type class_allowed, +bool animate_a_corpse(const coord_def &a, corpse_type class_allowed, beh_type beha, unsigned short hitting, god_type god, bool actual, bool quiet) @@ -877,7 +877,7 @@ bool animate_a_corpse(int x, int y, corpse_type class_allowed, bool success = false; // Search all the items on the ground for a corpse. - for (stack_iterator si(igrd[x][y]); si; ++si) + for (stack_iterator si(a); si; ++si) { if (_is_animatable_corpse(*si) && (class_allowed == CORPSE_BODY @@ -885,8 +885,7 @@ bool animate_a_corpse(int x, int y, corpse_type class_allowed, { const bool was_butchering = is_being_butchered(*si); - success = _raise_corpse(x, y, si.link(), beha, hitting, god, - actual); + success = _raise_corpse(a, si.link(), beha, hitting, god, actual); if (actual && success) { @@ -895,7 +894,7 @@ bool animate_a_corpse(int x, int y, corpse_type class_allowed, if (was_butchering) mpr("The corpse you are butchering rises to attack!"); - if (is_terrain_seen(x, y)) + if (is_terrain_seen(a)) mpr("The dead are walking!"); } @@ -965,8 +964,8 @@ int animate_dead(actor *caster, int pow, beh_type beha, unsigned short hitting, if (is_being_butchered(*si, false)) was_butchering = true; - if (animate_a_corpse(a.x, a.y, CORPSE_BODY, beha, - hitting, god, actual, true)) + if (animate_a_corpse(a, CORPSE_BODY, beha, hitting, god, + actual, true)) { number_raised++; -- cgit v1.2.3-54-g00ecf