diff --git a/asm/field_map_obj.s b/asm/field_map_obj.s index 5801bbc5f3..0ea219238c 100644 --- a/asm/field_map_obj.s +++ b/asm/field_map_obj.s @@ -5,28 +5,6 @@ .text - thumb_func_start npcs_clear_ids_and_state -npcs_clear_ids_and_state: @ 808D410 - push {r4,r5,lr} - movs r4, 0 - ldr r5, =gUnknown_02037350 -_0808D416: - lsls r0, r4, 3 - adds r0, r4 - lsls r0, 2 - adds r0, r5 - bl npc_clear_ids_and_state - adds r0, r4, 0x1 - lsls r0, 24 - lsrs r4, r0, 24 - cmp r4, 0xF - bls _0808D416 - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end npcs_clear_ids_and_state - thumb_func_start sub_808D438 sub_808D438: @ 808D438 push {lr} diff --git a/include/field_map_obj.h b/include/field_map_obj.h index ebc4457943..e40f090627 100644 --- a/include/field_map_obj.h +++ b/include/field_map_obj.h @@ -5,6 +5,8 @@ // Exported RAM declarations +extern struct MapObject gUnknown_02037350[16]; + // Exported ROM declarations #endif //POKEEMERALD_FIELD_MAP_OBJ_H diff --git a/src/field_map_obj.c b/src/field_map_obj.c index 9451863b4d..1931827759 100644 --- a/src/field_map_obj.c +++ b/src/field_map_obj.c @@ -21,3 +21,12 @@ void npc_clear_ids_and_state(struct MapObject *mapObject) mapObject->mapGroup = -1; mapObject->mapobj_unk_1C = -1; } + +void npcs_clear_ids_and_state(void) +{ + u8 i; + for (i = 0; i < ARRAY_COUNT(gUnknown_02037350); i ++) + { + npc_clear_ids_and_state(&gUnknown_02037350[i]); + } +}