From e1b7b8af0a431f4624fc668a58b535a8be438d72 Mon Sep 17 00:00:00 2001 From: edave64 Date: Wed, 2 Apr 2025 16:49:15 +0200 Subject: Use constants for PP masks instead of magic numbers (#504) --- engine/battle/core.asm | 16 ++++++++-------- engine/battle/effects.asm | 2 +- 2 files changed, 9 insertions(+), 9 deletions(-) (limited to 'engine/battle') diff --git a/engine/battle/core.asm b/engine/battle/core.asm index f304af10..4fe7880f 100644 --- a/engine/battle/core.asm +++ b/engine/battle/core.asm @@ -2644,7 +2644,7 @@ SelectMenuItem: ld b, $0 add hl, bc ld a, [hl] - and $3f + and PP_MASK jr z, .noPP ld a, [wPlayerDisabledMove] swap a @@ -2724,7 +2724,7 @@ AnyMoveToSelect: or [hl] inc hl or [hl] - and $3f + and PP_MASK ret nz jr .noMovesLeft .handleDisabledMove @@ -2878,7 +2878,7 @@ PrintMenuItem: ld hl, wBattleMonPP add hl, bc ld a, [hl] - and $3f + and PP_MASK ld [wBattleMenuCurrentPP], a ; print TYPE/ and / hlcoord 1, 9 @@ -4071,18 +4071,18 @@ CheckForDisobedience: ld hl, wBattleMonPP push hl ld a, [hli] - and $3f + and PP_MASK ld b, a ld a, [hli] - and $3f + and PP_MASK add b ld b, a ld a, [hli] - and $3f + and PP_MASK add b ld b, a ld a, [hl] - and $3f + and PP_MASK add b pop hl push af @@ -4091,7 +4091,7 @@ CheckForDisobedience: ld b, $0 add hl, bc ld a, [hl] - and $3f + and PP_MASK ld b, a pop af cp b diff --git a/engine/battle/effects.asm b/engine/battle/effects.asm index 439e41e2..5782a3f0 100644 --- a/engine/battle/effects.asm +++ b/engine/battle/effects.asm @@ -1332,7 +1332,7 @@ DisableEffect: or [hl] inc hl or [hl] - and $3f + and PP_MASK pop hl ; wBattleMonPP or wEnemyMonPP jr z, .moveMissedPopHL ; nothing to do if all moves have no PP left add hl, bc -- cgit v1.3.1-sl0p