shithub: pokecrystal

Download patch

ref: 5ac4a517513da3acc80abdac0cc74f39b5f92907
parent: 67207fab94bbe24c79260dd0ad1be4e0579552c4
author: Idain <luiscarlosholguinperez@outlook.com>
date: Mon Jan 10 16:57:40 EST 2022

Use time constants more often (#867)


--- a/engine/overworld/time.asm
+++ b/engine/overworld/time.asm
@@ -390,7 +390,7 @@
 	ld c, a
 	sbc [hl]
 	jr nc, .skip
-	add 24
+	add MAX_HOUR
 .skip
 	ld [hl], c ; current hours
 	dec hl
--- a/engine/pokegear/pokegear.asm
+++ b/engine/pokegear/pokegear.asm
@@ -1271,9 +1271,9 @@
 
 GetAMPMHours: ; unreferenced
 	ldh a, [hHours]
-	cp 12
+	cp NOON_HOUR
 	jr c, .am
-	sub 12
+	sub NOON_HOUR
 	ld [wTempByteValue], a
 	scf
 	ret
--- a/mobile/mobile_40.asm
+++ b/mobile/mobile_40.asm
@@ -1083,7 +1083,7 @@
 	ldh a, [hHours]
 	sbc c
 	jr nc, .asm_1006fb
-	add $18
+	add MAX_HOUR
 
 .asm_1006fb
 	ld [de], a