summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBardur Arantsson <bardur@scientician.net>2017-05-02 19:20:57 +0200
committerBardur Arantsson <bardur@scientician.net>2017-05-02 19:20:57 +0200
commit536adca4d3937216e4c7191366ae2bd43a961f87 (patch)
tree63c4b8955faa549bc07b434bf0b23e8c155de969
parenta40e1d524849e22edf2fb65b5c2fedbe47a59b81 (diff)
Remove unused global variable 'unsafe'
-rw-r--r--src/spells1.cc44
-rw-r--r--src/spells1.hpp1
2 files changed, 18 insertions, 27 deletions
diff --git a/src/spells1.cc b/src/spells1.cc
index 5217a803..3c7999d1 100644
--- a/src/spells1.cc
+++ b/src/spells1.cc
@@ -6794,10 +6794,6 @@ bool_ project_m(int who, int r, int y, int x, int dam, int typ)
}
-/* Is the spell unsafe for the player ? */
-bool_ unsafe = FALSE;
-
-
/*
* Helper function for "project()" below.
*
@@ -6851,7 +6847,7 @@ static bool_ project_p(int who, int r, int y, int x, int dam, int typ, int a_rad
if ((x != p_ptr->px) || (y != p_ptr->py)) return (FALSE);
/* Player cannot hurt himself */
- if ((!who) && (!unsafe)) return (FALSE);
+ if (!who) return (FALSE);
/* Bolt attack from a monster */
if ((!a_rad) && get_skill(SKILL_DODGE) && (who > 0))
@@ -7557,30 +7553,26 @@ static bool_ project_p(int who, int r, int y, int x, int dam, int typ, int a_rad
if (dungeon_flags & DF_NO_TELEPORT) break; /* No teleport on special levels */
if (fuzzy) msg_print("You are hit by something heavy!");
msg_print("Gravity warps around you.");
- if (!unsafe)
- {
- teleport_player(5);
- if (!p_ptr->ffall)
- (void)set_slow(p_ptr->slow + rand_int(4) + 4);
- if (!(p_ptr->resist_sound || p_ptr->ffall))
- {
- int k = (randint((dam > 90) ? 35 : (dam / 3 + 5)));
- (void)set_stun(p_ptr->stun + k);
- }
- if (p_ptr->ffall)
- {
- dam = (dam * 2) / 3;
- }
- if ((!p_ptr->ffall) || (randint(13) == 1))
- {
- inven_damage(set_cold_destroy, 2);
- }
+ teleport_player(5);
+ if (!p_ptr->ffall)
+ (void)set_slow(p_ptr->slow + rand_int(4) + 4);
+ if (!(p_ptr->resist_sound || p_ptr->ffall))
+ {
+ int k = (randint((dam > 90) ? 35 : (dam / 3 + 5)));
+ (void)set_stun(p_ptr->stun + k);
+ }
+ if (p_ptr->ffall)
+ {
+ dam = (dam * 2) / 3;
+ }
- take_hit(dam, killer);
+ if ((!p_ptr->ffall) || (randint(13) == 1))
+ {
+ inven_damage(set_cold_destroy, 2);
}
- else
- teleport_player(dam);
+
+ take_hit(dam, killer);
break;
}
diff --git a/src/spells1.hpp b/src/spells1.hpp
index a2996bf8..9760c5e9 100644
--- a/src/spells1.hpp
+++ b/src/spells1.hpp
@@ -32,5 +32,4 @@ void do_poly_self(void);
void corrupt_player(void);
std::string name_spell(random_spell const *);
void generate_spell(int plev);
-extern bool_ unsafe;
s16b do_poly_monster(int y, int x);