diff options
| author | MegaMech <7255464+MegaMech@users.noreply.github.com> | 2024-12-30 20:39:31 -0700 |
|---|---|---|
| committer | MegaMech <7255464+MegaMech@users.noreply.github.com> | 2024-12-30 20:39:31 -0700 |
| commit | 7ee714e4e93609a5dbf1dc648df0ce504e3d7284 (patch) | |
| tree | e63c623057b555fedd3d017b5d6c34d12de31098 /src/engine/objects/Penguin.cpp | |
| parent | 41fb92b7b989290947d8f39c442219afe12d0215 (diff) | |
| parent | 57afb90c3901b4c5dc586f1be3f6604c52c423d6 (diff) | |
Merge branch 'next' of https://github.com/MegaMech/SpaghettiKart into next
Diffstat (limited to 'src/engine/objects/Penguin.cpp')
| -rw-r--r-- | src/engine/objects/Penguin.cpp | 16 |
1 files changed, 10 insertions, 6 deletions
diff --git a/src/engine/objects/Penguin.cpp b/src/engine/objects/Penguin.cpp index c126174a1..c690e1ef2 100644 --- a/src/engine/objects/Penguin.cpp +++ b/src/engine/objects/Penguin.cpp @@ -33,16 +33,19 @@ extern "C" { extern s8 gPlayerCount; } -OPenguin::OPenguin(s32 i, Vec3f pos, u16 direction, PenguinType type, Behaviour behaviour) { - if (i >= 32) { +size_t OPenguin::_count = 0; + +OPenguin::OPenguin(Vec3f pos, u16 direction, PenguinType type, Behaviour behaviour) { + _idx = _count; + _type = type; + _bhv = behaviour; + + if (_idx >= 32) { printf("MAX penguin REACHED (32), skipping\n"); return; } - _idx = i; - _type = type; - _bhv = behaviour; - s32 objectIndex = indexObjectList1[i]; + s32 objectIndex = indexObjectList1[_idx]; init_object(objectIndex, 0); Object *object = &gObjectList[objectIndex]; @@ -73,6 +76,7 @@ OPenguin::OPenguin(s32 i, Vec3f pos, u16 direction, PenguinType type, Behaviour break; } + _count++; } void OPenguin::Tick(void) { |
