From 58dd36fe3da3552965e1ab976cadd773d8afbe71 Mon Sep 17 00:00:00 2001 From: AnonymousRandomPerson Date: Fri, 8 Aug 2025 23:47:03 -0400 Subject: [PATCH] Synced from pmdsky-debug --- asm/include/main_02058F24.inc | 2 +- asm/include/overlay_29_0231EDFC.inc | 2 +- asm/include/overlay_29_0231F594.inc | 2 +- asm/include/overlay_29_023201A0.inc | 2 +- asm/include/overlay_29_02322DDC.inc | 2 +- asm/include/overlay_29_0232393C.inc | 2 +- asm/include/overlay_29_0233861C.inc | 2 +- asm/include/overlay_29_023456BC.inc | 2 +- asm/include/overlay_29_02346834.inc | 2 +- asm/include/overlay_31_023838E4.inc | 2 +- asm/main_02000DE0.s | 6 +++--- asm/main_02058F24.s | 4 ++-- asm/overlay_29_0231EDFC.s | 2 +- asm/overlay_29_0231F594.s | 2 +- asm/overlay_29_023201A0.s | 2 +- asm/overlay_29_02322DDC.s | 12 ++++++------ asm/overlay_29_0232393C.s | 2 +- asm/overlay_29_0233861C.s | 4 ++-- asm/overlay_29_023456BC.s | 2 +- asm/overlay_29_02346834.s | 2 +- asm/overlay_31_023838E4.s | 8 ++++---- include/dungeon_projectile_throw.h | 4 ++-- include/overlay_31_02383478.h | 2 +- src/dungeon_projectile_throw.c | 24 ++++++++++++------------ src/overlay_31_02383478.c | 4 ++-- src/overlay_31_02383880.c | 2 +- 26 files changed, 51 insertions(+), 51 deletions(-) diff --git a/asm/include/main_02058F24.inc b/asm/include/main_02058F24.inc index db5af7f8..471c4607 100644 --- a/asm/include/main_02058F24.inc +++ b/asm/include/main_02058F24.inc @@ -363,7 +363,7 @@ .public SetSpecialEpisodeType .public SetSpriteIdForAnimationControl .public ShowPortraitInPortraitBox -.public sin_4096 +.public SinAbs4096 .public SPECIAL_BAND_STAT_BOOST .public STATUS_NAME_STRING_IDS .public strcat diff --git a/asm/include/overlay_29_0231EDFC.inc b/asm/include/overlay_29_0231EDFC.inc index 2c462e7d..98ab670f 100644 --- a/asm/include/overlay_29_0231EDFC.inc +++ b/asm/include/overlay_29_0231EDFC.inc @@ -26,7 +26,7 @@ .public ov29_0232033C .public ov29_02321238 .public ShouldDisplayEntityWrapper -.public sin_4096 +.public SinAbs4096 .public SubstitutePlaceholderStringTags .public TryWarp .public TwoTurnMoveForcedMiss diff --git a/asm/include/overlay_29_0231F594.inc b/asm/include/overlay_29_0231F594.inc index a7558b2b..50d62935 100644 --- a/asm/include/overlay_29_0231F594.inc +++ b/asm/include/overlay_29_0231F594.inc @@ -24,7 +24,7 @@ .public ov29_023457C8 .public RemoveGroundItem .public SetEntityPixelPosXY -.public sin_4096 +.public SinAbs4096 .public SpawnItem .public UpdateMinimap .public UpdateTrapsVisibility diff --git a/asm/include/overlay_29_023201A0.inc b/asm/include/overlay_29_023201A0.inc index 9c76d4c9..ed625026 100644 --- a/asm/include/overlay_29_023201A0.inc +++ b/asm/include/overlay_29_023201A0.inc @@ -29,7 +29,7 @@ .public ov29_02353700 .public RemoveGroundItem .public ShouldDisplayEntityWrapper -.public sin_4096 +.public SinAbs4096 .public SubstitutePlaceholderStringTags .public UpdateEntityPixelPos .public UpdateMinimap diff --git a/asm/include/overlay_29_02322DDC.inc b/asm/include/overlay_29_02322DDC.inc index a8c3b9f2..98dd030a 100644 --- a/asm/include/overlay_29_02322DDC.inc +++ b/asm/include/overlay_29_02322DDC.inc @@ -42,7 +42,7 @@ .public PlayMoveAnimation .public SetPreprocessorArgsIdVal .public ShouldDisplayEntityWrapper -.public sin_4096 +.public SinAbs4096 .public sub_02001980 .public sub_0201CF90 .public TwoTurnMoveForcedMiss diff --git a/asm/include/overlay_29_0232393C.inc b/asm/include/overlay_29_0232393C.inc index 7dab1c15..e9c10ec8 100644 --- a/asm/include/overlay_29_0232393C.inc +++ b/asm/include/overlay_29_0232393C.inc @@ -41,5 +41,5 @@ .public PlayMoveAnimation .public PositionHasMonster .public QUICK_DODGER_MOVE_ACCURACY_DROP -.public sin_4096 +.public SinAbs4096 .public TwoTurnMoveForcedMiss diff --git a/asm/include/overlay_29_0233861C.inc b/asm/include/overlay_29_0233861C.inc index e7a886ce..b6ee7c40 100644 --- a/asm/include/overlay_29_0233861C.inc +++ b/asm/include/overlay_29_0233861C.inc @@ -80,7 +80,7 @@ .public ResetInnerBoundaryTileRows .public SECONDARY_TERRAIN_TYPES .public ShouldMinimapDisplayEntity -.public sin_4096 +.public SinAbs4096 .public StairsAlwaysReachable .public sub_0200A174 .public sub_0200B330 diff --git a/asm/include/overlay_29_023456BC.inc b/asm/include/overlay_29_023456BC.inc index f2164c48..09b2304a 100644 --- a/asm/include/overlay_29_023456BC.inc +++ b/asm/include/overlay_29_023456BC.inc @@ -44,7 +44,7 @@ .public SetEntityPixelPosXY .public SetPreprocessorArgsIdVal .public ShouldDisplayEntityWrapper -.public sin_4096 +.public SinAbs4096 .public SpawnItem .public sub_0200D1FC .public sub_0201B9F8 diff --git a/asm/include/overlay_29_02346834.inc b/asm/include/overlay_29_02346834.inc index a5a957c6..d4559f85 100644 --- a/asm/include/overlay_29_02346834.inc +++ b/asm/include/overlay_29_02346834.inc @@ -60,7 +60,7 @@ .public RemoveEmptyItemsInBag .public SetEntityPixelPosXY .public SetItemAcquired -.public sin_4096 +.public SinAbs4096 .public SpawnDroppedItem .public sub_0200CF6C .public sub_0200D894 diff --git a/asm/include/overlay_31_023838E4.inc b/asm/include/overlay_31_023838E4.inc index e052c60f..5ec83f86 100644 --- a/asm/include/overlay_31_023838E4.inc +++ b/asm/include/overlay_31_023838E4.inc @@ -63,7 +63,7 @@ .public DUNGEON_WINDOW_PARAMS_31 .public DUNGEON_WINDOW_PARAMS_32 .public DUNGEON_WINDOW_PARAMS_9 -.public EntityIsValid__02383658 +.public EntityIsValidOverlay31 .public FormatMoveString .public FormatMoveStringMore .public GetActiveTeamMember diff --git a/asm/main_02000DE0.s b/asm/main_02000DE0.s index 2019133f..c3cd5f62 100644 --- a/asm/main_02000DE0.s +++ b/asm/main_02000DE0.s @@ -859,8 +859,8 @@ _020018C4: bx lr arm_func_end sub_020018A4 - arm_func_start sin_4096 -sin_4096: ; 0x020018D0 + arm_func_start SinAbs4096 +SinAbs4096: ; 0x020018D0 and r1, r0, #0xc00 cmp r1, #0x400 bgt _020018EC @@ -913,7 +913,7 @@ _02001970: .align 2, 0 _02001978: .word _02090C48 _0200197C: .word 0x000003FF - arm_func_end sin_4096 + arm_func_end SinAbs4096 arm_func_start sub_02001980 sub_02001980: ; 0x02001980 diff --git a/asm/main_02058F24.s b/asm/main_02058F24.s index 7f00ecbd..0f1a5b6e 100644 --- a/asm/main_02058F24.s +++ b/asm/main_02058F24.s @@ -22511,7 +22511,7 @@ _0206B580: bl MultiplyByFixedPoint str r0, [r6, #0x18] ldr r0, [r6, #0x20] - bl sin_4096 + bl SinAbs4096 add r1, sl, #0x300 rsb r0, r0, #0 bl MultiplyByFixedPoint @@ -23206,7 +23206,7 @@ sub_0206BFA8: ; 0x0206BFA8 ldr r1, [r4, #0x30] add r7, r1, r0 ldr r0, [r4, #0x20] - bl sin_4096 + bl SinAbs4096 ldr r1, [r4, #0x24] rsb r0, r0, #0 bl MultiplyByFixedPoint diff --git a/asm/overlay_29_0231EDFC.s b/asm/overlay_29_0231EDFC.s index 32f209a7..f5e21dc3 100644 --- a/asm/overlay_29_0231EDFC.s +++ b/asm/overlay_29_0231EDFC.s @@ -345,7 +345,7 @@ _0231F294: cmp r0, #0 beq _0231F308 mov r0, r7 - bl sin_4096 + bl SinAbs4096 mov r0, r0, lsl #5 str r0, [r4, #0x1c] mov r0, #0x3b diff --git a/asm/overlay_29_0231F594.s b/asm/overlay_29_0231F594.s index c424e382..39a64e91 100644 --- a/asm/overlay_29_0231F594.s +++ b/asm/overlay_29_0231F594.s @@ -407,7 +407,7 @@ _0231FA9C: str r0, [sp, #4] bl IncrementEntityPixelPosXY mov r0, r8 - bl sin_4096 + bl SinAbs4096 mov r1, #0xc mul r1, r0, r1 ldr r0, [sp, #4] diff --git a/asm/overlay_29_023201A0.s b/asm/overlay_29_023201A0.s index b972f4b6..853bb1b1 100644 --- a/asm/overlay_29_023201A0.s +++ b/asm/overlay_29_023201A0.s @@ -164,7 +164,7 @@ _023203C0: mov r0, r5 str r8, [sp, #4] str sb, [sp, #8] - bl sin_4096 + bl SinAbs4096 mov r1, #0xc mul r1, r0, r1 str r1, [sl, #0x1c] diff --git a/asm/overlay_29_02322DDC.s b/asm/overlay_29_02322DDC.s index 4c46fde2..d4831d0b 100644 --- a/asm/overlay_29_02322DDC.s +++ b/asm/overlay_29_02322DDC.s @@ -532,7 +532,7 @@ _02323538: cmp fp, #1 bne _02323564 mov r0, sb, asr #8 - bl sin_4096 + bl SinAbs4096 mul r0, r4, r0 str r0, [sp, #0x50] mov r2, #0 @@ -544,13 +544,13 @@ _02323564: movne r2, r0 bne _023235B4 mov r0, sb, asr #8 - bl sin_4096 + bl SinAbs4096 ldr r1, [sp, #0x3c] mul r0, r1, r0 mov r0, r0, asr #8 str r0, [sp, #0x74] ldr r0, [sp, #0x40] - bl sin_4096 + bl SinAbs4096 ldr r1, [sp, #0x74] mul r0, r1, r0 str r0, [sp, #0x50] @@ -584,7 +584,7 @@ _02323600: cmp fp, #1 bne _0232362C mov r0, sb, asr #8 - bl sin_4096 + bl SinAbs4096 ldr r1, [sp, #0x34] mov r2, #0 mul r0, r1, r0 @@ -597,13 +597,13 @@ _0232362C: strne r0, [sp, #0x4c] bne _0232367C mov r0, sb, asr #8 - bl sin_4096 + bl SinAbs4096 ldr r1, [sp, #0x3c] mul r0, r1, r0 mov r0, r0, asr #8 str r0, [sp, #0x70] ldr r0, [sp, #0x30] - bl sin_4096 + bl SinAbs4096 ldr r1, [sp, #0x70] mul r0, r1, r0 str r0, [sp, #0x4c] diff --git a/asm/overlay_29_0232393C.s b/asm/overlay_29_0232393C.s index bcf64803..568f4008 100644 --- a/asm/overlay_29_0232393C.s +++ b/asm/overlay_29_0232393C.s @@ -139,7 +139,7 @@ _02323B14: movne r0, #0 bne _02323B3C mov r0, r5, asr #8 - bl sin_4096 + bl SinAbs4096 ldr r1, [sp, #0x14] mul r0, r1, r0 _02323B3C: diff --git a/asm/overlay_29_0233861C.s b/asm/overlay_29_0233861C.s index 44e9d653..db6e2bf4 100644 --- a/asm/overlay_29_0233861C.s +++ b/asm/overlay_29_0233861C.s @@ -516,7 +516,7 @@ _02338B74: b _02338C48 _02338BBC: ldr r0, [r6, #0x25c] - bl sin_4096 + bl SinAbs4096 ldr r3, [r6, #0x254] mov r2, #0xa mov r1, r0 @@ -526,7 +526,7 @@ _02338BBC: add r0, r1, r0 str r0, [r6, #0x24c] ldr r0, [r6, #0x260] - bl sin_4096 + bl SinAbs4096 ldr r3, [r6, #0x258] mov r2, #0xa mov r1, r0 diff --git a/asm/overlay_29_023456BC.s b/asm/overlay_29_023456BC.s index c7913420..427ec1ef 100644 --- a/asm/overlay_29_023456BC.s +++ b/asm/overlay_29_023456BC.s @@ -1158,7 +1158,7 @@ _0234665C: str r0, [sp, #0xc] bl IncrementEntityPixelPosXY mov r0, fp - bl sin_4096 + bl SinAbs4096 mov r1, #0xc mul r1, r0, r1 ldr r0, [sp, #0xc] diff --git a/asm/overlay_29_02346834.s b/asm/overlay_29_02346834.s index 7ccf9dd1..29d38b3e 100644 --- a/asm/overlay_29_02346834.s +++ b/asm/overlay_29_02346834.s @@ -1066,7 +1066,7 @@ _0234744C: add r0, r1, r0 str r0, [sp, #0x10] mov r0, r7 - bl sin_4096 + bl SinAbs4096 mov r1, #0xc mul r1, r0, r1 str r1, [sl, #0x1c] diff --git a/asm/overlay_31_023838E4.s b/asm/overlay_31_023838E4.s index 29573d12..7aa3fd41 100644 --- a/asm/overlay_31_023838E4.s +++ b/asm/overlay_31_023838E4.s @@ -219,7 +219,7 @@ _02383BEC: add r0, r0, #0x12000 ldr r8, [r0, #0xb28 + OV31_023838E4_OFFSET] mov r0, r8 - bl EntityIsValid__02383658 + bl EntityIsValidOverlay31 cmp r0, #0 beq _02383C38 ldr r1, [r8, #0xb4] @@ -730,7 +730,7 @@ _02384320: add r0, r0, #0x12000 ldr fp, [r0, #0xb28 + OV31_023838E4_OFFSET] mov r0, fp - bl EntityIsValid__02383658 + bl EntityIsValidOverlay31 cmp r0, #0 beq _02384374 ldr r1, [fp, #0xb4] @@ -1025,7 +1025,7 @@ _02384758: add r0, r0, #0x12000 ldr r0, [r0, #0xb28 + OV31_023838E4_OFFSET] str r0, [sp, #0x1c] - bl EntityIsValid__02383658 + bl EntityIsValidOverlay31 cmp r0, #0 beq _023847A0 ldr r0, [sp, #0x1c] @@ -1224,7 +1224,7 @@ _023849F4: add r0, r0, #0x12000 ldr r0, [r0, #0xb28 + OV31_023838E4_OFFSET] str r0, [sp, #0x20] - bl EntityIsValid__02383658 + bl EntityIsValidOverlay31 cmp r0, #0 beq _02384C48 mov r0, #0 diff --git a/include/dungeon_projectile_throw.h b/include/dungeon_projectile_throw.h index 9229c4b3..b2aac0e7 100644 --- a/include/dungeon_projectile_throw.h +++ b/include/dungeon_projectile_throw.h @@ -24,11 +24,11 @@ bool8 ExclusiveItemEffectIsActive__02347B80(struct entity *entity, enum exclusiv // Checks if an entity pointer points to a valid entity (not entity type 0, which represents no entity). bool8 EntityIsValid__02347BA4(struct entity *entity); // Throws an item in a curved arc, like a Gravelerock. -// thrower: monster entity throwing the item +// user: monster entity throwing the item // item: item being thrown // start_pos: position to start throwing the item from // target_pos: position to throw the item to // projectile_throw_info: Metadata about the item being thrown -void HandleCurvedProjectileThrow(struct entity *thrower, struct item *item, struct position *start_pos, struct position *target_pos, struct projectile_throw_info *projectile_throw_info); +void HandleCurvedProjectileThrow(struct entity *user, struct item *item, struct position *start_pos, struct position *target_pos, struct projectile_throw_info *projectile_throw_info); #endif //PMDSKY_OVERLAY_29_02347BA4_H diff --git a/include/overlay_31_02383478.h b/include/overlay_31_02383478.h index 9b5f557b..605fb520 100644 --- a/include/overlay_31_02383478.h +++ b/include/overlay_31_02383478.h @@ -23,6 +23,6 @@ struct loc_struct { char* ov31_02383478(char* arg1, s32 arg2, u32 arg3); // Checks if an entity pointer points to a valid entity (not entity type 0, which represents no entity). -bool8 EntityIsValid__02383658(struct entity *entity); +bool8 EntityIsValidOverlay31(struct entity *entity); #endif //PMDSKY_OVERLAY_31_02383478_H diff --git a/src/dungeon_projectile_throw.c b/src/dungeon_projectile_throw.c index 43c6ef87..2cfb254a 100644 --- a/src/dungeon_projectile_throw.c +++ b/src/dungeon_projectile_throw.c @@ -22,7 +22,7 @@ extern bool8 ov29_022E2CA0(struct position *pos); extern void ov29_0234B4CC(bool8 val); -extern s32 sin_4096(s32 x); +extern s32 SinAbs4096(s32 x); extern bool8 ov29_022E9488(s32 inX, s32 inY, u8 index); extern bool8 ov29_023457C8(struct entity *entity, bool8 hallucinating, u8 a2, u8 a3, u8 a4); extern void AdvanceFrame(u32); @@ -32,7 +32,7 @@ extern void PrepareItemForPrinting__02345754(u8 *buffer, struct item *item); extern void SubstitutePlaceholderStringTags(u8 *string_id, struct entity *entity, u32 param_3); extern void ov29_02304A84(struct entity *entity, u32 new_dir); extern void LogMessageByIdWithPopupCheckUserTarget(struct entity *user, struct entity *target, u32 message_id); -extern bool8 TryEndPetrifiedOrSleepStatus(struct entity *pokemon, struct entity *target); +extern bool8 TryEndPetrifiedOrSleepStatus(struct entity *user, struct entity *target); extern void ApplyItemEffect(char param_1, u8 param_2, u8 param_3, struct entity *attacker, struct entity *defender, struct item *thrown_item); extern void SpawnDroppedItem(struct entity *entity, struct entity *item_entity, struct item *item, bool8 param_4, struct position *dir_xy, u32 param_6); @@ -61,7 +61,7 @@ bool8 EntityIsValid__02347BA4(struct entity *entity) return GetEntityType(entity) != ENTITY_NOTHING; } -void HandleCurvedProjectileThrow(struct entity *thrower, struct item *item, struct position *start_pos, struct position *target_pos, struct projectile_throw_info *projectile_throw_info) +void HandleCurvedProjectileThrow(struct entity *user, struct item *item, struct position *start_pos, struct position *target_pos, struct projectile_throw_info *projectile_throw_info) { struct entity *projectile; bool8 r4; @@ -88,7 +88,7 @@ void HandleCurvedProjectileThrow(struct entity *thrower, struct item *item, stru throwResult = 1; lockOnSpecs = FALSE; - if (GetEntityType(thrower) == ENTITY_MONSTER && ItemIsActive__02347B50(thrower, ITEM_LOCKON_SPECS)) { + if (GetEntityType(user) == ENTITY_MONSTER && ItemIsActive__02347B50(user, ITEM_LOCKON_SPECS)) { lockOnSpecs = TRUE; } @@ -140,7 +140,7 @@ void HandleCurvedProjectileThrow(struct entity *thrower, struct item *item, stru u8 terrainArg; runFrameActions = FALSE; - sinVal = sin_4096(sinePhase >> 8) * arcHeight; + sinVal = SinAbs4096(sinePhase >> 8) * arcHeight; displayX = posXFixed + 0x400; displayY = posYFixed + 0x400; @@ -189,7 +189,7 @@ void HandleCurvedProjectileThrow(struct entity *thrower, struct item *item, stru hitResult.did_hit = FALSE; } else { - hitResult.did_hit = DoesProjectileHitTarget(thrower, hitResult.target); + hitResult.did_hit = DoesProjectileHitTarget(user, hitResult.target); } PrepareItemForPrinting__02345754(0, item); @@ -198,17 +198,17 @@ void HandleCurvedProjectileThrow(struct entity *thrower, struct item *item, stru bool8 immobiSlpEndMsg; ov29_02304A84(hitResult.target, 8); - LogMessageByIdWithPopupCheckUserTarget(thrower, hitResult.target, CURVED_PROJECTILE_LOG_MESSAGE_1); - immobiSlpEndMsg = TryEndPetrifiedOrSleepStatus(thrower, hitResult.target); - ApplyItemEffect(1, (lockOnSpecs || projectile_throw_info->unk0 != 0) ? 1 : 0, immobiSlpEndMsg, thrower, hitResult.target, item); + LogMessageByIdWithPopupCheckUserTarget(user, hitResult.target, CURVED_PROJECTILE_LOG_MESSAGE_1); + immobiSlpEndMsg = TryEndPetrifiedOrSleepStatus(user, hitResult.target); + ApplyItemEffect(1, (lockOnSpecs || projectile_throw_info->unk0 != 0) ? 1 : 0, immobiSlpEndMsg, user, hitResult.target, item); throwResult = 0; } else { if (hasBounceBand) { - LogMessageByIdWithPopupCheckUserTarget(thrower, hitResult.target, CURVED_PROJECTILE_LOG_MESSAGE_2); + LogMessageByIdWithPopupCheckUserTarget(user, hitResult.target, CURVED_PROJECTILE_LOG_MESSAGE_2); } else { - LogMessageByIdWithPopupCheckUserTarget(thrower, hitResult.target, CURVED_PROJECTILE_LOG_MESSAGE_3); + LogMessageByIdWithPopupCheckUserTarget(user, hitResult.target, CURVED_PROJECTILE_LOG_MESSAGE_3); } throwResult = 1; } @@ -220,7 +220,7 @@ void HandleCurvedProjectileThrow(struct entity *thrower, struct item *item, stru case 2: break; case 1: - SpawnDroppedItem(thrower, projectile, item, FALSE, NULL, 0); + SpawnDroppedItem(user, projectile, item, FALSE, NULL, 0); break; } } diff --git a/src/overlay_31_02383478.c b/src/overlay_31_02383478.c index b2647696..5df68809 100644 --- a/src/overlay_31_02383478.c +++ b/src/overlay_31_02383478.c @@ -47,7 +47,7 @@ char* ov31_02383478(char* arg1, s32 arg2, u32 arg3) if (GET_BIT(BAG_ITEMS_PTR_MIRROR->bag_items->bag_items[arg2].flags, 0) && BAG_ITEMS_PTR_MIRROR->bag_items->bag_items[arg2].held_by) { u32 r1 = (BAG_ITEMS_PTR_MIRROR->bag_items->bag_items[arg2].held_by - 1); - if (EntityIsValid__02383658(DUNGEON_PTR[0]->monster_slots.party_members[r1]) == 0) { + if (EntityIsValidOverlay31(DUNGEON_PTR[0]->monster_slots.party_members[r1]) == 0) { sub_0200D894(&(BAG_ITEMS_PTR_MIRROR->bag_items->bag_items[arg2])); } } @@ -56,7 +56,7 @@ char* ov31_02383478(char* arg1, s32 arg2, u32 arg3) return arg1; } -bool8 EntityIsValid__02383658(struct entity *entity) +bool8 EntityIsValidOverlay31(struct entity *entity) { if (entity == NULL) return FALSE; diff --git a/src/overlay_31_02383880.c b/src/overlay_31_02383880.c index 1c2e2611..6efec43a 100644 --- a/src/overlay_31_02383880.c +++ b/src/overlay_31_02383880.c @@ -70,7 +70,7 @@ void ov31_02383880(u8* arg1) arg1[0] = 0; count = arg1[0] + 1; for (s32 i=0; i < MAX_TEAM_MEMBERS; i++) { - u8 test = EntityIsValid__02383658(DUNGEON_PTR[0]->monster_slots.party_members[i]); + u8 test = EntityIsValidOverlay31(DUNGEON_PTR[0]->monster_slots.party_members[i]); if (!test) { arg1[i+1] = 0; } else {