Skip to content

Commit edaf118

Browse files
committed
Update the return type for BtlUnit_GetBelong
1 parent 2b143ab commit edaf118

File tree

2 files changed

+12
-5
lines changed

2 files changed

+12
-5
lines changed

ttyd-tools/rel/include/ttyd/battle_unit.h

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,13 @@
44

55
namespace ttyd::battle_unit {
66

7+
enum class ActorGroupBelong : uint8_t
8+
{
9+
kParty = 0,
10+
kEnemy,
11+
kExtra,
12+
};
13+
714
extern "C" {
815

916
// BtlUnit_CheckShadowGuard
@@ -63,7 +70,7 @@ bool BtlUnit_CheckStatus(void *battleUnitPtr, uint32_t status);
6370
// BtlUnit_SetStatus
6471
// BtlUnit_GetStatus
6572
// _CheckMoveCount
66-
bool BtlUnit_GetBelong(void *battleUnitPtr);
73+
ActorGroupBelong BtlUnit_GetBelong(void *battleUnitPtr);
6774
// BtlUnit_SetJumpSpeed
6875
// BtlUnit_SetPartsMoveSpeed
6976
// BtlUnit_SetMoveSpeed

ttyd-tools/rel/source/codes.cpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -92,11 +92,11 @@ void displayArtAttackHitboxes()
9292
continue;
9393
}
9494

95-
// Check if the current actor is Mario or one of the partners
96-
bool BattleUnitBelong = ttyd::battle_unit::BtlUnit_GetBelong(BattleUnitPtr);
97-
if (!BattleUnitBelong)
95+
// Check if the current actor is a normal enemy that can be attacked
96+
ttyd::battle_unit::ActorGroupBelong BattleUnitBelong = ttyd::battle_unit::BtlUnit_GetBelong(BattleUnitPtr);
97+
if (BattleUnitBelong != ttyd::battle_unit::ActorGroupBelong::kEnemy)
9898
{
99-
// The current actor is either Mario or one of the partners, so don't draw the hitbox
99+
// The current actor is not a normal enemy that can be attacked, so don't draw the hitbox
100100
continue;
101101
}
102102

0 commit comments

Comments
 (0)