diff --git a/include/map.h b/include/map.h index e804934649..960d5c0405 100644 --- a/include/map.h +++ b/include/map.h @@ -192,10 +192,10 @@ typedef struct Enemy { typedef struct { /* 0x00 */ s32 npcCount; /* 0x04 */ StaticNpc* npcs; - /* 0x08 */ s32 battleID; + /* 0x08 */ FormationID formationID; } NpcGroupList[]; // size = 0x0C -#define NPC_GROUP(npcs, battleID) { sizeof(npcs) / sizeof(StaticNpc), &npcs, battleID } +#define NPC_GROUP(npcs, formationID) { sizeof(npcs) / sizeof(StaticNpc), &npcs, formationID } #define NPC_GROUP_LIST_END() { 0, 0, 0 } Enemy* get_enemy(NpcId npcId); diff --git a/include/types.h b/include/types.h index 8686cc3795..ac7a5dcf3d 100644 --- a/include/types.h +++ b/include/types.h @@ -10,4 +10,7 @@ #define UNK_FUN_PTR(name) void(*name)(void) #define UNK_ARGS +typedef s32 FormationID; +#define FORMATION_ID(section, stage, index) (section << 16) + (stage << 8) + index + #endif diff --git a/src/world/area_kmr/kmr_12/events.c b/src/world/area_kmr/kmr_12/events.c index bf67e7bb02..6c986d20fa 100644 --- a/src/world/area_kmr/kmr_12/events.c +++ b/src/world/area_kmr/kmr_12/events.c @@ -191,7 +191,7 @@ static StaticNpc goomba_npc = { }; static NpcGroupList npc_groups = { - NPC_GROUP(goomba_npc, 0x00010003), + NPC_GROUP(goomba_npc, FORMATION_ID(1, 0, 3)), NPC_GROUP_LIST_END(), };