changeset 44:2e83348f665a

Handle player power capping correctly with thews flask Previously, there was no check for power level overflow when using a thews flask. This can cause unexpected behaviour if a thews flask is used when the player power level is close to the maximum. Instead, check for overflow and cap it if overflow happens.
author William Astle <lost@l-w.ca>
date Fri, 30 Dec 2016 13:36:43 -0700
parents dd6248b6adaf
children c6f72faedb9a
files dod.s
diffstat 1 files changed, 3 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/dod.s	Wed Dec 23 12:35:10 2015 -0700
+++ b/dod.s	Fri Dec 30 13:36:43 2016 -0700
@@ -3733,7 +3733,9 @@
 		fdb LD7A0
 LD77A		ldd #1000			; thews increases player power by 1000
 		addd powerlevel			; add to existing power value
-		std powerlevel			; save new power value
+		bpl LD77Aa			; brif not overflow
+		ldd #32767			; cap player power
+LD77Aa		std powerlevel			; save new power value
 		bra LD792			; go empty the flask and update things
 LD783		clra				; new damage level = 0
 		clrb