From 660d7466ae2011b2e7ebe5b80b37c68193a49aa7 Mon Sep 17 00:00:00 2001 From: dolorous Date: Sun, 6 Jul 2008 13:19:52 +0000 Subject: Add miscellaneous minor fixes. git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@6421 c06c8d41-db1a-0410-9941-cceddc491573 --- crawl-ref/source/spells2.cc | 30 +++++++++++++++--------------- 1 file changed, 15 insertions(+), 15 deletions(-) (limited to 'crawl-ref/source/spells2.cc') diff --git a/crawl-ref/source/spells2.cc b/crawl-ref/source/spells2.cc index fa7bfee000..0c9d2244f9 100644 --- a/crawl-ref/source/spells2.cc +++ b/crawl-ref/source/spells2.cc @@ -884,42 +884,42 @@ bool vampiric_drain(int pow, const dist &vmove) char burn_freeze(int pow, beam_type flavour) { int mgr = NON_MONSTER; - struct dist bmove; + dist spd; - if (pow > 25) - pow = 25; + pow = std::min(25, pow); while (mgr == NON_MONSTER) { mpr("Which direction?", MSGCH_PROMPT); - direction( bmove, DIR_DIR, TARG_ENEMY ); + direction(spd, DIR_DIR, TARG_ENEMY); - if (!bmove.isValid) + if (!spd.isValid) { canned_msg(MSG_OK); - return -1; + return (-1); } - if (bmove.isMe) + if (spd.isMe) { canned_msg(MSG_UNTHINKING_ACT); - return -1; + return (-1); } - mgr = mgrd[you.x_pos + bmove.dx][you.y_pos + bmove.dy]; + mgr = mgrd[you.x_pos + spd.dx][you.y_pos + spd.dy]; - // Yes, this is strange, but it does maintain the original behaviour. - // Possibly to avoid giving information about invisible monsters? + // Yes, this is strange, but it does maintain the original + // behaviour. Possibly to avoid giving information about + // invisible monsters? if (mgr == NON_MONSTER) { mpr("There isn't anything close enough!"); - return 0; + return (0); } - if (trans_wall_blocking( bmove.tx, bmove.ty )) + if (trans_wall_blocking(spd.tx, spd.ty)) { mpr("A translucent wall is in the way."); - return 0; + return (0); } } @@ -983,7 +983,7 @@ char burn_freeze(int pow, beam_type flavour) } } - return 1; + return (1); } bool summon_animals(int pow) -- cgit v1.2.3-54-g00ecf