diff options
author | PikalaxALT <pikalaxalt@gmail.com> | 2017-09-16 18:52:20 -0400 |
---|---|---|
committer | PikalaxALT <pikalaxalt@gmail.com> | 2017-09-16 18:52:20 -0400 |
commit | 7d58ce75ad421762f9820492d77b6b05c632f60b (patch) | |
tree | 36822c17068caef3770e0956e2680259775d6577 /src | |
parent | fedbcd7bb7202f37f4a3a017a2f4c1fe296a6ae3 (diff) |
sub_8092C8C
Diffstat (limited to 'src')
-rwxr-xr-x | src/field_map_obj.c | 42 |
1 files changed, 38 insertions, 4 deletions
diff --git a/src/field_map_obj.c b/src/field_map_obj.c index 5ec5e68f4..a876797a4 100755 --- a/src/field_map_obj.c +++ b/src/field_map_obj.c @@ -3658,18 +3658,52 @@ u8 npc_block_way(struct MapObject *mapObject, s16 x, s16 y, u32 dirn) direction = dirn; if (IsCoordOutsideFieldObjectMovementRect(mapObject, x, y)) + { return 1; - else if (MapGridIsImpassableAt(x, y) || GetMapBorderIdAt(x, y) == -1 || IsMetatileDirectionallyImpassable(mapObject, x, y, direction)) + } + if (MapGridIsImpassableAt(x, y) || GetMapBorderIdAt(x, y) == -1 || IsMetatileDirectionallyImpassable(mapObject, x, y, direction)) + { return 2; - else if (mapObject->mapobj_bit_15 && !CanCameraMoveInDirection(direction)) + } + if (mapObject->mapobj_bit_15 && !CanCameraMoveInDirection(direction)) + { return 2; - else if (IsZCoordMismatchAt(mapObject->mapobj_unk_0B_0, x, y)) + } + if (IsZCoordMismatchAt(mapObject->mapobj_unk_0B_0, x, y)) + { return 3; - else if (CheckForCollisionBetweenFieldObjects(mapObject, x, y)) + } + if (CheckForCollisionBetweenFieldObjects(mapObject, x, y)) + { return 4; + } return 0; } +u8 sub_8092C8C(struct MapObject *mapObject, s16 x, s16 y, u8 direction) +{ + u8 retval; + + retval = 0x00; + if (IsCoordOutsideFieldObjectMovementRect(mapObject, x, y)) + { + retval |= 1; + } + if (MapGridIsImpassableAt(x, y) || GetMapBorderIdAt(x, y) == -1 || IsMetatileDirectionallyImpassable(mapObject, x, y, direction) || (mapObject->mapobj_bit_15 && !CanCameraMoveInDirection(direction))) + { + retval |= 2; + } + if (IsZCoordMismatchAt(mapObject->mapobj_unk_0B_0, x, y)) + { + retval |= 4; + } + if (CheckForCollisionBetweenFieldObjects(mapObject, x, y)) + { + retval |= 8; + } + return retval; +} + asm(".section .text.get_face_direction_anim_id"); void FieldObjectClearAnimIfSpecialAnimActive(struct MapObject *); |