mirror of
https://github.com/DarkflameUniverse/DarkflameServer.git
synced 2025-11-16 15:18:49 +00:00
fix: ape anchor not respawning (#1927)
* fix: ape anchor not respawning * add return Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> --------- Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
This commit is contained in:
@@ -92,7 +92,7 @@ void BaseEnemyApe::OnTimerDone(Entity* self, std::string timerName) {
|
||||
new LDFData<LWOOBJID>(u"ape", self->GetObjectID())
|
||||
};
|
||||
|
||||
auto* anchor = Game::entityManager->CreateEntity(entityInfo);
|
||||
auto* anchor = Game::entityManager->CreateEntity(entityInfo, nullptr, self);
|
||||
Game::entityManager->ConstructEntity(anchor);
|
||||
self->SetVar<LWOOBJID>(u"QB", anchor->GetObjectID());
|
||||
|
||||
@@ -140,3 +140,9 @@ void BaseEnemyApe::StunApe(Entity* self, bool stunState) {
|
||||
self->SetBoolean(u"knockedOut", stunState);
|
||||
}
|
||||
}
|
||||
|
||||
void BaseEnemyApe::OnChildRemoved(Entity& self, GameMessages::ChildRemoved& childRemoved) {
|
||||
if (self.GetVar<LWOOBJID>(u"QB") == childRemoved.childID) {
|
||||
self.SetVar<LWOOBJID>(u"QB", LWOOBJID_EMPTY);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -10,6 +10,7 @@ public:
|
||||
void OnTimerDone(Entity* self, std::string timerName) override;
|
||||
void OnFireEventServerSide(Entity* self, Entity* sender, std::string args, int32_t param1, int32_t param2,
|
||||
int32_t param3) override;
|
||||
void OnChildRemoved(Entity& self, GameMessages::ChildRemoved& childRemoved) override;
|
||||
private:
|
||||
static void StunApe(Entity* self, bool stunState);
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user