Attached Files |
0001-Fixing-draining-in-fsim.patch [^] (1,519 bytes) 2014-03-27 22:46 [Show Content] [Hide Content]From a0ef91ec20333bc8ec1e73fd4aeb539ba40948a1 Mon Sep 17 00:00:00 2001
From: Keanan Smith <keanan.smith@gmail.com>
Date: Thu, 27 Mar 2014 15:39:38 -0600
Subject: [PATCH] Fixing draining in fsim
---
crawl-ref/source/wiz-fsim.cc | 5 +++--
1 file changed, 3 insertions(+), 2 deletions(-)
diff --git a/crawl-ref/source/wiz-fsim.cc b/crawl-ref/source/wiz-fsim.cc
index c8225b9..9c18368 100644
--- a/crawl-ref/source/wiz-fsim.cc
+++ b/crawl-ref/source/wiz-fsim.cc
@@ -364,11 +364,12 @@ static fight_data _get_fight_data(monster &mon, int iter_limit, bool defend)
{
for (int i = 0; i < iter_limit; i++)
{
+ int prev_hps; // Store previous hps, max_hit_points can be changed by draining
// This sets mgrid(mons.pos()) to NON_MONSTER
mon = orig;
// Re-place the monster if it e.g. blinked away.
mon.move_to_pos(start_pos);
- mon.hit_points = mon.max_hit_points;
+ prev_hps = mon.hit_points = mon.max_hit_points;
mon.shield_blocks = 0;
you.time_taken = player_speed();
@@ -400,7 +401,7 @@ static fight_data _get_fight_data(monster &mon, int iter_limit, bool defend)
you.hunger = hunger;
time_taken += you.time_taken * 10;
- int damage = (mon.max_hit_points - mon.hit_points);
+ int damage = (prev_hps - mon.hit_points);
cumulative_damage += damage;
if (damage > fdata.max_dam)
fdata.max_dam = damage;
--
1.8.1.2
|