ref: 3332305bb4bce2534a0bd3de0e4c419a98738fc8
parent: f1366d615f2b5d9602fe94a2512a5b3804484f26
author: Rangi <remy.oukaour+rangi42@gmail.com>
date: Fri Jan 26 07:27:02 EST 2018
Define more bit flag constants
--- a/constants/map_object_constants.asm
+++ b/constants/map_object_constants.asm
@@ -52,6 +52,11 @@
SLIDING EQU 3
EMOTE_OBJECT EQU 7
+; object_struct OBJECT_FLAGS2 bit flags
+LOW_PRIORITY EQU 0
+HIGH_PRIORITY EQU 1
+OVERHEAD EQU 3
+
; map_object struct members (see macros/wram.asm)
const_def
--- a/engine/map_objects.asm
+++ b/engine/map_objects.asm
@@ -233,7 +233,7 @@
UpdateTallGrassFlags: ; 463f
ld hl, OBJECT_FLAGS2
add hl, bc
- bit 3, [hl] ; is current tile grass?
+ bit OVERHEAD, [hl]
jr z, .ok
ld hl, OBJECT_NEXT_TILE
add hl, bc
@@ -260,13 +260,13 @@
.set
ld hl, OBJECT_FLAGS2
add hl, bc
- set 3, [hl]
+ set OVERHEAD, [hl]
ret
.reset
ld hl, OBJECT_FLAGS2
add hl, bc
- res 3, [hl]
+ res OVERHEAD, [hl]
ret
; 4679
@@ -2918,10 +2918,10 @@
ld e, PRIORITY_LOW
ld hl, OBJECT_FLAGS2
add hl, bc
- bit 0, [hl]
+ bit LOW_PRIORITY, [hl]
jr nz, .add
ld e, PRIORITY_NORM
- bit 1, [hl]
+ bit HIGH_PRIORITY, [hl]
jr z, .add
ld e, PRIORITY_HIGH
jr .add
--- a/engine/movement.asm
+++ b/engine/movement.asm
@@ -838,7 +838,7 @@
ld hl, OBJECT_FLAGS2
add hl, bc
- res 3, [hl]
+ res OVERHEAD, [hl]
ld hl, OBJECT_ACTION
add hl, bc