From 432d5fea3010964bc807c56d56f2e30b41c4c327 Mon Sep 17 00:00:00 2001 From: Paul Gilbert Date: Sun, 29 Apr 2018 14:30:08 -0400 Subject: XEEN: Fix original bug prematurely resetting WEAK condition --- engines/xeen/interface.cpp | 4 ++++ engines/xeen/party.cpp | 8 ++++++-- 2 files changed, 10 insertions(+), 2 deletions(-) (limited to 'engines/xeen') diff --git a/engines/xeen/interface.cpp b/engines/xeen/interface.cpp index c00079b73b..fe196bb2e5 100644 --- a/engines/xeen/interface.cpp +++ b/engines/xeen/interface.cpp @@ -1077,6 +1077,10 @@ void Interface::rest() { c._conditions[UNCONSCIOUS] = 0; c._currentHp = c.getMaxHP(); c._currentSp = c.getMaxSP(); + + // WORKAROUND: Resting curing weakness only originally worked due to a bug in changeTime + // resetting WEAK if party wasn't drunk. With that resolved, we have to reset WEAK here + c._conditions[WEAK] = 0; } } } diff --git a/engines/xeen/party.cpp b/engines/xeen/party.cpp index 0d4cd29881..b4b57e75ee 100644 --- a/engines/xeen/party.cpp +++ b/engines/xeen/party.cpp @@ -464,8 +464,12 @@ void Party::changeTime(int numMinutes) { } } - player._conditions[WEAK] = player._conditions[DRUNK]; - player._conditions[DRUNK] = 0; + // WORKAROUND: Original incorrectly reset weakness (due to lack of sleep) even when party + // wasn't drunk. We now have any resetting drunkness add to, rather than replace, weakness + if (player._conditions[WEAK] != -1) { + player._conditions[WEAK] += player._conditions[DRUNK]; + player._conditions[DRUNK] = 0; + } if (player._conditions[DEPRESSED]) { player._conditions[DEPRESSED] = (player._conditions[DEPRESSED] + 1) % 4; -- cgit v1.2.3