From f0889aadb67d0b7295759e00f571ea221fffe204 Mon Sep 17 00:00:00 2001 From: lepelog <25211966+lepelog@users.noreply.github.com> Date: Thu, 4 Dec 2025 23:26:13 +0100 Subject: [PATCH] properly use subtype enum --- include/d/t/d_t_insect.h | 12 ++++++------ src/REL/d/t/d_t_insect.cpp | 2 +- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/include/d/t/d_t_insect.h b/include/d/t/d_t_insect.h index 0e591e8e..874d5099 100644 --- a/include/d/t/d_t_insect.h +++ b/include/d/t/d_t_insect.h @@ -61,16 +61,16 @@ private: /* 0x260 */ mVec3_c mRevealedSpawnPos; /* 0x26C */ dAcRef_c mWarpRef; - s32 getSpawnSubtype() const { - return (mParams >> 8 & 0xF); + SpawnSubtype getSpawnSubtype() const { + return (SpawnSubtype)(mParams >> 8 & 0xF); } - bool isSpawnSubtype(s32 spanwSubtype) const { + bool isSpawnSubtype(SpawnSubtype spanwSubtype) const { return getSpawnSubtype() == spanwSubtype; } - s32 getSubtype() const { - return (mParams >> 4 & 0xF); + Subtype getSubtype() const { + return (Subtype)(mParams >> 4 & 0xF); } - bool isSubtype(u8 subtype) const { + bool isSubtype(Subtype subtype) const { return getSubtype() == subtype; } s32 getInsectCount() const { diff --git a/src/REL/d/t/d_t_insect.cpp b/src/REL/d/t/d_t_insect.cpp index d430c313..19fd7333 100644 --- a/src/REL/d/t/d_t_insect.cpp +++ b/src/REL/d/t/d_t_insect.cpp @@ -77,7 +77,7 @@ inline bool checkProfile(u16 prof, u32 target) { } int dTgInsect_c::actorPostCreate() { - s32 subtype = mParams >> 4 & 0xF; + Subtype subtype = getSubtype(); // ??? doesn't match without the double comparison if (subtype == SUBTYPE_WOODLAND_RHINO_BEETLE || subtype == SUBTYPE_WOODLAND_RHINO_BEETLE