mirror of
https://github.com/DarkflameUniverse/DarkflameServer.git
synced 2024-11-12 19:28:21 +00:00
Fix shark stinky fish death animation (#1004)
This commit is contained in:
parent
6d989f37f1
commit
b6fc959433
@ -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);
|
||||||
}
|
}
|
||||||
|
@ -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;
|
||||||
};
|
};
|
||||||
|
Loading…
Reference in New Issue
Block a user