summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--asm/field_map_obj.s19
-rw-r--r--src/field_map_obj.c10
2 files changed, 9 insertions, 20 deletions
diff --git a/asm/field_map_obj.s b/asm/field_map_obj.s
index 8179cb0ec..b41d6607e 100644
--- a/asm/field_map_obj.s
+++ b/asm/field_map_obj.s
@@ -5,25 +5,6 @@
.text
- thumb_func_start FieldObjectHandleDynamicGraphicsId
-@ void FieldObjectHandleDynamicGraphicsId(struct npc_state *fieldObject)
-FieldObjectHandleDynamicGraphicsId: @ 808E6DC
- push {r4,lr}
- adds r4, r0, 0
- ldrb r0, [r4, 0x5]
- cmp r0, 0xEF
- bls _0808E6F2
- adds r0, 0x10
- lsls r0, 24
- lsrs r0, 24
- bl VarGetFieldObjectGraphicsId
- strb r0, [r4, 0x5]
-_0808E6F2:
- pop {r4}
- pop {r0}
- bx r0
- thumb_func_end FieldObjectHandleDynamicGraphicsId
-
thumb_func_start npc_by_local_id_and_map_set_field_1_bit_x20
npc_by_local_id_and_map_set_field_1_bit_x20: @ 808E6F8
push {r4,lr}
diff --git a/src/field_map_obj.c b/src/field_map_obj.c
index 775a7b4e4..c8d25341f 100644
--- a/src/field_map_obj.c
+++ b/src/field_map_obj.c
@@ -27,7 +27,7 @@ static void sub_808D450(void);
static u8 GetFieldObjectIdByLocalId(u8);
static u8 GetFieldObjectIdByLocalIdAndMapInternal(u8, u8, u8);
static bool8 GetAvailableFieldObjectSlot(u16, u8, u8, u8 *);
-/*static*/ void FieldObjectHandleDynamicGraphicsId(struct MapObject *);
+static void FieldObjectHandleDynamicGraphicsId(struct MapObject *);
static void RemoveFieldObjectInternal (struct MapObject *);
/*static*/ u16 GetFieldObjectFlagIdByFieldObjectId(u8);
/*static*/ const struct MapObjectGraphicsInfo *GetFieldObjectGraphicsInfo(u8);
@@ -1027,3 +1027,11 @@ const struct MapObjectGraphicsInfo *GetFieldObjectGraphicsInfo(u8 graphicsId)
}
return gFieldObjectGraphicsInfoPointers[graphicsId];
}
+
+static void FieldObjectHandleDynamicGraphicsId(struct MapObject *mapObject)
+{
+ if (mapObject->graphicsId >= SPRITE_VAR)
+ {
+ mapObject->graphicsId = VarGetFieldObjectGraphicsId(mapObject->graphicsId - SPRITE_VAR);
+ }
+}