diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/lua_bind.cc | 18 | ||||
-rw-r--r-- | src/spells3.cc | 20 |
2 files changed, 18 insertions, 20 deletions
diff --git a/src/lua_bind.cc b/src/lua_bind.cc index 6b22e1d2..cc55d815 100644 --- a/src/lua_bind.cc +++ b/src/lua_bind.cc @@ -188,24 +188,6 @@ s32b get_level(s32b s, s32b max, s32b min) } } -void get_target(int dir, int *y, int *x) -{ - int ty, tx; - - /* Use the given direction */ - tx = p_ptr->px + (ddx[dir] * 100); - ty = p_ptr->py + (ddy[dir] * 100); - - /* Hack -- Use an actual "target" */ - if ((dir == 5) && target_okay()) - { - tx = target_col; - ty = target_row; - } - *y = ty; - *x = tx; -} - /* Level gen */ void get_map_size(const char *name, int *ysize, int *xsize) { 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); |