diff --git a/asm/field_map_obj.s b/asm/field_map_obj.s index 9a8294ab2..a6333af8f 100755 --- a/asm/field_map_obj.s +++ b/asm/field_map_obj.s @@ -5,45 +5,6 @@ .text - thumb_func_start npc_set_running_behaviour_etc -npc_set_running_behaviour_etc: @ 8092B2C - push {r4,lr} - mov r12, r0 - lsls r1, 24 - lsrs r1, 24 - movs r3, 0 - strb r1, [r0, 0x6] - adds r0, 0x21 - strb r3, [r0] - adds r0, 0x1 - strb r3, [r0] - ldr r4, =gSprites - mov r0, r12 - ldrb r2, [r0, 0x4] - lsls r0, r2, 4 - adds r0, r2 - lsls r0, 2 - adds r2, r4, 0 - adds r2, 0x1C - adds r0, r2 - ldr r2, =gUnknown_08505438 - lsls r1, 2 - adds r1, r2 - ldr r1, [r1] - str r1, [r0] - mov r0, r12 - ldrb r1, [r0, 0x4] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r4 - strh r3, [r0, 0x30] - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end npc_set_running_behaviour_etc - thumb_func_start npc_running_behaviour_by_direction npc_running_behaviour_by_direction: @ 8092B78 lsls r0, 24 diff --git a/include/global.fieldmap.h b/include/global.fieldmap.h index f8955b9fd..4a587cf57 100644 --- a/include/global.fieldmap.h +++ b/include/global.fieldmap.h @@ -299,6 +299,7 @@ struct MapObject2 /*0x1F*/ u8 mapobj_unk_1F; /*0x20*/ u8 mapobj_unk_20; /*0x21*/ u8 mapobj_unk_21; + /*0x22*/ u8 animId; /*size = 0x24*/ }; diff --git a/src/field_map_obj.c b/src/field_map_obj.c index 2987c09ee..06fd36be3 100755 --- a/src/field_map_obj.c +++ b/src/field_map_obj.c @@ -3626,6 +3626,15 @@ u8 sub_8092AF8(s16 x1, s16 y1, s16 x2, s16 y2) return DIR_SOUTH; } +void npc_set_running_behaviour_etc(struct MapObject *mapObject, u8 animPattern) +{ + mapObject->animPattern = animPattern; + mapObject->mapobj_unk_21 = 0; + mapObject->animId = 0; + gSprites[mapObject->spriteId].callback = gUnknown_08505438[animPattern]; + gSprites[mapObject->spriteId].data1 = 0; +} + asm(".section .text.get_face_direction_anim_id"); void FieldObjectClearAnimIfSpecialAnimActive(struct MapObject *);