From 9fd7f5bc149e7fa7ae2597bc39ca7fd348997424 Mon Sep 17 00:00:00 2001 From: j-p-e-g Date: Wed, 11 Jun 2008 22:55:29 +0000 Subject: Extend monster pathfinding to monsters circumventing pools of deep water or lava. I've added some more checks to avoid hampering performance too much, but of course there's still space for improvement. Once per turn check whether the player can see water and/or lava, and only if this is the case run the additional checks (monster habitat, grid_see_grid) when a monster tries to move. Smart monsters that have a ranged attack won't use pathfinding either since they can directly fire at the player. (This is identical to their pre-pathfinding behaviour.) Also fix butterflies really not interrupting resting. (Setting it to 0 doesn't work for some reason.) git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@5737 c06c8d41-db1a-0410-9941-cceddc491573 --- crawl-ref/source/tags.cc | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'crawl-ref/source/tags.cc') diff --git a/crawl-ref/source/tags.cc b/crawl-ref/source/tags.cc index caa83181df..dc0932e8d5 100644 --- a/crawl-ref/source/tags.cc +++ b/crawl-ref/source/tags.cc @@ -996,6 +996,9 @@ static void tag_construct_you(writer &th) marshallShort(th, you.transit_stair); marshallByte(th, you.entering_level); + // lava_in_sight and water_in_sight don't need to be saved as they can + // be recalculated on game start + // List of currently beholding monsters (usually empty). marshallByte(th, you.beheld_by.size()); for (unsigned int k = 0; k < you.beheld_by.size(); k++) @@ -1383,6 +1386,9 @@ static void tag_read_you(reader &th, char minorVersion) you.transit_stair = static_cast(unmarshallShort(th)); you.entering_level = unmarshallByte(th); + // These two need not be saved. + you.lava_in_sight = false; + you.water_in_sight = false; // List of currently beholding monsters (usually empty). count_c = unmarshallByte(th); -- cgit v1.2.3-54-g00ecf