Fix shark stinky fish death animation (#1004)

This commit is contained in:
David Markowitz 2023-02-28 15:30:28 -08:00 committed by GitHub
parent 6d989f37f1
commit b6fc959433
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 6 additions and 1 deletions

View File

@ -1,6 +1,7 @@
#include "StinkyFishTarget.h" #include "StinkyFishTarget.h"
#include "EntityManager.h" #include "EntityManager.h"
#include "EntityInfo.h" #include "EntityInfo.h"
#include "Entity.h"
void StinkyFishTarget::OnStartup(Entity* self) { void StinkyFishTarget::OnStartup(Entity* self) {
auto position = self->GetPosition(); auto position = self->GetPosition();
@ -16,6 +17,7 @@ void StinkyFishTarget::OnSkillEventFired(Entity* self, Entity* caster, const std
self->SetVar<LWOOBJID>(u"player", caster->GetObjectID()); self->SetVar<LWOOBJID>(u"player", caster->GetObjectID());
EntityInfo entityInfo{}; EntityInfo entityInfo{};
entityInfo.lot = SHARK_LOT;
entityInfo.pos = self->GetPosition(); entityInfo.pos = self->GetPosition();
entityInfo.rot = self->GetRotation(); entityInfo.rot = self->GetRotation();
entityInfo.spawnerID = self->GetObjectID(); entityInfo.spawnerID = self->GetObjectID();
@ -35,7 +37,7 @@ void StinkyFishTarget::OnTimerDone(Entity* self, std::string timerName) {
const auto playerID = self->GetVar<LWOOBJID>(u"player"); const auto playerID = self->GetVar<LWOOBJID>(u"player");
auto* fish = EntityManager::Instance()->GetEntity(self->GetVar<LWOOBJID>(u"fish")); auto* fish = EntityManager::Instance()->GetEntity(self->GetVar<LWOOBJID>(u"fish"));
if (fish != nullptr) { if (fish) {
fish->Smash(playerID); fish->Smash(playerID);
self->Smash(playerID); self->Smash(playerID);
} }

View File

@ -2,7 +2,10 @@
#include "CppScripts.h" #include "CppScripts.h"
class StinkyFishTarget : public CppScripts::Script { class StinkyFishTarget : public CppScripts::Script {
public:
void OnStartup(Entity* self) override; void OnStartup(Entity* self) override;
void OnSkillEventFired(Entity* self, Entity* caster, const std::string& message) override; void OnSkillEventFired(Entity* self, Entity* caster, const std::string& message) override;
void OnTimerDone(Entity* self, std::string timerName) override; void OnTimerDone(Entity* self, std::string timerName) override;
private:
const LOT SHARK_LOT = 8570;
}; };