diff options
| author | MegaMech <inkstudios1@hotmail.com> | 2024-12-29 23:57:26 -0700 |
|---|---|---|
| committer | MegaMech <inkstudios1@hotmail.com> | 2024-12-29 23:57:26 -0700 |
| commit | 2bd41c6d90995cff7387e11374843cbe9e62b10f (patch) | |
| tree | c431d7aaa840e6277d53dc54c8f1edb7408e3bb0 /src/engine/objects/Penguin.cpp | |
| parent | 08e4bf37979131e76e617beafb3f5ca6286e5ebb (diff) | |
Fix Seagull, classes count their own instances --> cleanup
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) { |
