summaryrefslogtreecommitdiffstats
path: root/crawl-ref/source/view.cc
diff options
context:
space:
mode:
authorj-p-e-g <j-p-e-g@c06c8d41-db1a-0410-9941-cceddc491573>2008-06-12 06:55:11 +0000
committerj-p-e-g <j-p-e-g@c06c8d41-db1a-0410-9941-cceddc491573>2008-06-12 06:55:11 +0000
commit7142a710d849f6b0ad566c691278d524578b3a6a (patch)
treecbd29c164eceaccc412d254b5b95dd96d2ab9e78 /crawl-ref/source/view.cc
parent3369ae23fda553c05f6fc48c177f517503cb51ea (diff)
downloadcrawl-ref-7142a710d849f6b0ad566c691278d524578b3a6a.tar.gz
crawl-ref-7142a710d849f6b0ad566c691278d524578b3a6a.zip
Improve performance by only checking whether there are lava or deep
water grids nearby if the player recently moved (or restarted a game) and if a non-adjacent monster tries to reach the player. Remove now unneeded lua code (was used for the old pickup.lua) and make monsters switch away from ranged weapons when engaging you in melee. If a monster will still insist on hitting you with a sling it's a sure sign said sling is cursed (doesn't autoID, though). git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@5755 c06c8d41-db1a-0410-9941-cceddc491573
Diffstat (limited to 'crawl-ref/source/view.cc')
-rw-r--r--crawl-ref/source/view.cc14
1 files changed, 6 insertions, 8 deletions
diff --git a/crawl-ref/source/view.cc b/crawl-ref/source/view.cc
index 84be11376f..3e2c847ca6 100644
--- a/crawl-ref/source/view.cc
+++ b/crawl-ref/source/view.cc
@@ -5232,14 +5232,12 @@ void crawl_view_geometry::set_player_at(const coord_def &c, bool centre)
else
{
const coord_def oldc = vgrdc;
- const int xmarg =
- Options.scroll_margin_x + LOS_RADIUS <= viewhalfsz.x
- ? Options.scroll_margin_x
- : viewhalfsz.x - LOS_RADIUS;
- const int ymarg =
- Options.scroll_margin_y + LOS_RADIUS <= viewhalfsz.y
- ? Options.scroll_margin_y
- : viewhalfsz.y - LOS_RADIUS;
+ const int xmarg = Options.scroll_margin_x + LOS_RADIUS <= viewhalfsz.x
+ ? Options.scroll_margin_x
+ : viewhalfsz.x - LOS_RADIUS;
+ const int ymarg = Options.scroll_margin_y + LOS_RADIUS <= viewhalfsz.y
+ ? Options.scroll_margin_y
+ : viewhalfsz.y - LOS_RADIUS;
if (Options.view_lock_x)
vgrdc.x = c.x;