From 4cc5a6812537ba01f1c9ae96f5ad25e0a9f63134 Mon Sep 17 00:00:00 2001 From: David Lawrence Ramsey Date: Fri, 6 Nov 2009 16:23:26 -0600 Subject: Use coord_defs in a few more places. --- crawl-ref/source/acr.cc | 19 ++++++------------- crawl-ref/source/mon-act.cc | 2 +- 2 files changed, 7 insertions(+), 14 deletions(-) diff --git a/crawl-ref/source/acr.cc b/crawl-ref/source/acr.cc index 5ed7364a32..5c58d312f7 100644 --- a/crawl-ref/source/acr.cc +++ b/crawl-ref/source/acr.cc @@ -3175,19 +3175,15 @@ static void _open_door(coord_def move, bool check_confused) if (check_confused && you.confused() && !one_chance_in(3)) { do - { - move.x = random2(3) - 1; - move.y = random2(3) - 1; - } + move = coord_def(random2(3) - 1, random2(3) - 1); while (move.origin()); } if (_untrap_target(move, check_confused)) return; } - // If we get here, the player either hasn't picked a direction yet + // If we get here, the player either hasn't picked a direction yet, // or the chosen direction actually contains a closed door. - if (!player_can_open_doors()) { mpr("You can't open doors in your present form."); @@ -3226,10 +3222,7 @@ static void _open_door(coord_def move, bool check_confused) if (check_confused && you.confused() && !one_chance_in(3)) { do - { - door_move.delta.x = random2(3) - 1; - door_move.delta.y = random2(3) - 1; - } + door_move.delta = coord_def(random2(3) - 1, random2(3) - 1); while (door_move.delta.origin()); } @@ -3272,7 +3265,7 @@ static void _open_door(coord_def move, bool check_confused) if (is_exclude_root(doorpos) && !(check_confused && you.confused())) { std::string prompt = - make_stringf("This %s%s is marked as excluded! Open it " + make_stringf("This %s%s is marked as excluded! Open it " "anyway?", adj, noun); if (!yesno(prompt.c_str(), true, 'n', true, false)) @@ -3303,7 +3296,7 @@ static void _open_door(coord_def move, bool check_confused) else { const char* verb = (you.airborne() ? "reach down and open" - : "open"); + : "open"); mprf("You %s the %s%s.", verb, adj, noun); } @@ -3466,7 +3459,7 @@ static void _close_door(coord_def move) else { const char* verb = you.airborne() ? "reach down and close" - : "close"; + : "close"; mprf("You %s the %s%s.", verb, adj, noun); } diff --git a/crawl-ref/source/mon-act.cc b/crawl-ref/source/mon-act.cc index 088774e2a1..527944a726 100644 --- a/crawl-ref/source/mon-act.cc +++ b/crawl-ref/source/mon-act.cc @@ -2680,7 +2680,7 @@ static void _mons_open_door(monsters* monster, const coord_def &pos) monster->lose_energy(EUT_MOVE); } -static bool _habitat_okay( const monsters *monster, dungeon_feature_type targ ) +static bool _habitat_okay(const monsters *monster, dungeon_feature_type targ) { return (monster_habitable_grid(monster, targ)); } -- cgit v1.2.3-54-g00ecf