mirror of
https://github.com/DarkflameUniverse/DarkflameServer.git
synced 2025-10-09 08:58:04 +00:00
Move to shared pointer
This commit is contained in:
@@ -3,7 +3,7 @@
|
||||
|
||||
void BuccaneerValiantShip::OnStartup(Entity* self) {
|
||||
self->AddCallbackTimer(1.0F, [self]() {
|
||||
auto* skillComponent = self->GetComponent<SkillComponent>();
|
||||
auto skillComponent = self->GetComponent<SkillComponent>();
|
||||
auto* owner = self->GetOwner();
|
||||
|
||||
if (skillComponent != nullptr && owner != nullptr) {
|
||||
|
@@ -10,13 +10,13 @@ void PersonalFortress::OnStartup(Entity* self) {
|
||||
auto* owner = self->GetOwner();
|
||||
self->AddTimer("FireSkill", 1.5);
|
||||
|
||||
auto* destroyableComponent = owner->GetComponent<DestroyableComponent>();
|
||||
auto destroyableComponent = owner->GetComponent<DestroyableComponent>();
|
||||
if (destroyableComponent) destroyableComponent->SetStatusImmunity(
|
||||
eStateChangeType::PUSH,
|
||||
true, true, true, true, true, false, true, false, false
|
||||
);
|
||||
|
||||
auto* controllablePhysicsComponent = owner->GetComponent<ControllablePhysicsComponent>();
|
||||
auto controllablePhysicsComponent = owner->GetComponent<ControllablePhysicsComponent>();
|
||||
if (controllablePhysicsComponent) controllablePhysicsComponent->SetStunImmunity(
|
||||
eStateChangeType::PUSH, LWOOBJID_EMPTY,
|
||||
true, true, true, true, true, true
|
||||
@@ -31,13 +31,13 @@ void PersonalFortress::OnStartup(Entity* self) {
|
||||
|
||||
void PersonalFortress::OnDie(Entity* self, Entity* killer) {
|
||||
auto* owner = self->GetOwner();
|
||||
auto* destroyableComponent = owner->GetComponent<DestroyableComponent>();
|
||||
auto destroyableComponent = owner->GetComponent<DestroyableComponent>();
|
||||
if (destroyableComponent) destroyableComponent->SetStatusImmunity(
|
||||
eStateChangeType::POP,
|
||||
true, true, true, true, true, false, true, false, false
|
||||
);
|
||||
|
||||
auto* controllablePhysicsComponent = owner->GetComponent<ControllablePhysicsComponent>();
|
||||
auto controllablePhysicsComponent = owner->GetComponent<ControllablePhysicsComponent>();
|
||||
if (controllablePhysicsComponent) controllablePhysicsComponent->SetStunImmunity(
|
||||
eStateChangeType::POP, LWOOBJID_EMPTY,
|
||||
true, true, true, true, true, true
|
||||
@@ -52,7 +52,7 @@ void PersonalFortress::OnDie(Entity* self, Entity* killer) {
|
||||
|
||||
void PersonalFortress::OnTimerDone(Entity* self, std::string timerName) {
|
||||
if (timerName == "FireSkill") {
|
||||
auto* skillComponent = self->GetComponent<SkillComponent>();
|
||||
auto skillComponent = self->GetComponent<SkillComponent>();
|
||||
if (skillComponent) skillComponent->CalculateBehavior(650, 13364, LWOOBJID_EMPTY, true, false);
|
||||
}
|
||||
}
|
||||
|
@@ -4,14 +4,14 @@
|
||||
#include "eStateChangeType.h"
|
||||
|
||||
void StunImmunity::OnStartup(Entity* self) {
|
||||
auto* destroyableComponent = self->GetComponent<DestroyableComponent>();
|
||||
auto destroyableComponent = self->GetComponent<DestroyableComponent>();
|
||||
if (destroyableComponent) {
|
||||
destroyableComponent->SetStatusImmunity(
|
||||
eStateChangeType::PUSH, false, false, true, true, false, false, false, false, true
|
||||
);
|
||||
}
|
||||
|
||||
auto* controllablePhysicsComponent = self->GetComponent<ControllablePhysicsComponent>();
|
||||
auto controllablePhysicsComponent = self->GetComponent<ControllablePhysicsComponent>();
|
||||
if (controllablePhysicsComponent) {
|
||||
controllablePhysicsComponent->SetStunImmunity(
|
||||
eStateChangeType::PUSH, self->GetObjectID(), true
|
||||
|
Reference in New Issue
Block a user