|
From: <dsh...@us...> - 2007-04-03 18:39:14
|
Revision: 1205
http://svn.sourceforge.net/crawl-ref/?rev=1205&view=rev
Author: dshaligram
Date: 2007-04-03 11:39:12 -0700 (Tue, 03 Apr 2007)
Log Message:
-----------
Don't allow confused water/lava creatures to leave their habitat. Allowing them
out causes hard-to-balance problems.
Modified Paths:
--------------
trunk/crawl-ref/source/monstuff.cc
Modified: trunk/crawl-ref/source/monstuff.cc
===================================================================
--- trunk/crawl-ref/source/monstuff.cc 2007-04-03 18:29:07 UTC (rev 1204)
+++ trunk/crawl-ref/source/monstuff.cc 2007-04-03 18:39:12 UTC (rev 1205)
@@ -4297,7 +4297,15 @@
if (monster->confused())
{
if (mmov_x || mmov_y || one_chance_in(15))
- do_move_monster(monster, mmov_x, mmov_y);
+ {
+ coord_def newpos = monster->pos() + coord_def(mmov_x, mmov_y);
+ if (in_bounds(newpos)
+ && (monster_habitat(monster->type) == DNGN_FLOOR
+ || monster_habitable_grid(monster, grd(newpos))))
+ {
+ do_move_monster(monster, mmov_x, mmov_y);
+ }
+ }
return;
}
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|