Only Spawn Three ChainChomps for Rainbow Track (#569)

* Update RainbowRoad.cpp

* Update ChainChomp.cpp

* Decrement actor counters in destructor

* Update Finishline.cpp
This commit is contained in:
MegaMech 2025-11-23 13:18:51 -07:00 committed by GitHub
parent 52554e21cc
commit 96f02bd70f
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
7 changed files with 15 additions and 7 deletions

View File

@ -74,6 +74,7 @@ void AFinishline::Draw(Camera *camera) {
maxObjectsReached = render_set_position(mtx, 0) == 0;
if (maxObjectsReached) {
FrameInterpolation_RecordCloseChild();
return;
}

View File

@ -20,7 +20,9 @@ public:
*/
AFinishline(const SpawnParams& params);
virtual ~AFinishline() override = default;
~AFinishline() {
_count--;
}
// This is simply a helper function to keep Spawning code clean
static inline AFinishline* Spawn(FVector pos, IRotator rot) {

View File

@ -149,10 +149,6 @@ void RainbowRoad::BeginPlay() {
gWorldInstance.AddObject(new OChainChomp());
gWorldInstance.AddObject(new OChainChomp());
gWorldInstance.AddObject(new OChainChomp());
gWorldInstance.AddObject(new OChainChomp());
gWorldInstance.AddObject(new OChainChomp());
gWorldInstance.AddObject(new OChainChomp());
gWorldInstance.AddObject(new OChainChomp());
}
if (gModeSelection == VERSUS) {

View File

@ -20,8 +20,8 @@ OChainChomp::OChainChomp() {
Name = "Chain Chomp";
ResourceName = "mk:chain_chomp";
_idx = _count;
init_object(indexObjectList2[_count], 0);
_objectIndex = indexObjectList2[_count];
init_object(indexObjectList2[_idx], 0);
_objectIndex = indexObjectList2[_idx];
_count++;
}

View File

@ -41,6 +41,9 @@ public:
}
explicit OCrab(const SpawnParams& params);
~OCrab() {
_count--;
}
virtual void Tick() override;
virtual void Draw(s32 cameraId) override;

View File

@ -22,6 +22,9 @@ class OMoleGroup;
class OMole : public OObject {
public:
explicit OMole(FVector pos, OMoleGroup* group);
~OMole() {
_count--;
}
virtual void Tick() override;
virtual void Draw(s32 cameraId) override;

View File

@ -22,6 +22,9 @@ public:
* The mole must also be ready to jump to be considered.
*/
explicit OMoleGroup(std::vector<FVector>& moles, size_t tickRate);
~OMoleGroup() {
_count--;
}
virtual void Tick() override;