summaryrefslogtreecommitdiff
path: root/src/spells3.cc
diff options
context:
space:
mode:
authorBardur Arantsson <bardur@scientician.net>2014-12-23 17:57:57 +0100
committerBardur Arantsson <bardur@scientician.net>2014-12-23 18:06:14 +0100
commite5e7e636707a269b11bb4782b62073bc7a8d6193 (patch)
treecb7ef62e577c749dcbfe9e49eda9a113f1095d82 /src/spells3.cc
parent656ed9d951464e37ae58948dabb5e94ff39e5e1c (diff)
Move find_position() to spells3.cc
Said file is the only place it's currently used.
Diffstat (limited to 'src/spells3.cc')
-rw-r--r--src/spells3.cc11
1 files changed, 11 insertions, 0 deletions
diff --git a/src/spells3.cc b/src/spells3.cc
index 056d3de6..d6e14172 100644
--- a/src/spells3.cc
+++ b/src/spells3.cc
@@ -177,6 +177,17 @@ s32b get_level_s(int sp, int max)
return get_level(sp, max, 1);
}
+static void find_position(int y, int x, int *yy, int *xx)
+{
+ int attempts = 500;
+
+ do
+ {
+ scatter(yy, xx, y, x, 6);
+ }
+ while (!(in_bounds(*yy, *xx) && cave_floor_bold(*yy, *xx)) && --attempts);
+}
+
static casting_result cast(bool_ effect)
{
return effect ? CAST_OBVIOUS : CAST_HIDDEN;