summaryrefslogtreecommitdiff
path: root/src/spells3.cc
diff options
context:
space:
mode:
authorBardur Arantsson <bardur@scientician.net>2015-02-23 09:11:55 +0100
committerBardur Arantsson <bardur@scientician.net>2015-02-23 09:11:55 +0100
commit06a218fc412f612da52ec780b6c2a02ff691b693 (patch)
tree741392c5fb7c58ec2d939aea3adeb43a35decdab /src/spells3.cc
parent692699f064b2d792b61a5aa448b6844e8c713248 (diff)
Inline get_target() into the one extant caller
Diffstat (limited to 'src/spells3.cc')
-rw-r--r--src/spells3.cc20
1 files changed, 18 insertions, 2 deletions
diff --git a/src/spells3.cc b/src/spells3.cc
index 19f45d54..4bcc5a53 100644
--- a/src/spells3.cc
+++ b/src/spells3.cc
@@ -592,8 +592,24 @@ casting_result demonology_demon_madness(int item)
type = GF_CHARM;
}
- /* Calc the coordinates of arrival */
- get_target(dir, &y1, &x1);
+ // Calculate the coordinates of arrival
+ {
+ // Use the given direction
+ int tx = p_ptr->px + (ddx[dir] * 100);
+ int ty = p_ptr->py + (ddy[dir] * 100);
+
+ // Hack -- Use an actual "target"
+ if ((dir == 5) && target_okay())
+ {
+ tx = target_col;
+ ty = target_row;
+ }
+
+ y1 = ty;
+ x1 = tx;
+ }
+
+ // Calculate the appropriate place
y2 = p_ptr->py - (y1 - p_ptr->py);
x2 = p_ptr->px - (x1 - p_ptr->px);