mirror of
https://github.com/DarkflameUniverse/DarkflameServer.git
synced 2025-10-10 01:18:07 +00:00
Move to shared pointer
This commit is contained in:
@@ -16,7 +16,7 @@ void AgBusDoor::OnProximityUpdate(Entity* self, Entity* entering, std::string na
|
||||
// Make sure only humans are taken into account
|
||||
if (!entering->GetCharacter()) return;
|
||||
|
||||
auto* proximityMonitorComponent = self->GetComponent<ProximityMonitorComponent>();
|
||||
auto proximityMonitorComponent = self->GetComponent<ProximityMonitorComponent>();
|
||||
|
||||
if (proximityMonitorComponent == nullptr) return;
|
||||
|
||||
|
@@ -2,7 +2,7 @@
|
||||
#include "BaseCombatAIComponent.h"
|
||||
|
||||
void AgDarkSpiderling::OnStartup(Entity* self) {
|
||||
auto* combatAI = self->GetComponent<BaseCombatAIComponent>();
|
||||
auto combatAI = self->GetComponent<BaseCombatAIComponent>();
|
||||
if (combatAI != nullptr) {
|
||||
combatAI->SetStunImmune(true);
|
||||
}
|
||||
|
@@ -14,7 +14,7 @@ void AgFans::OnStartup(Entity* self) {
|
||||
|
||||
ToggleFX(self, false);
|
||||
|
||||
auto* renderComponent = static_cast<RenderComponent*>(self->GetComponent(eReplicaComponentType::RENDER));
|
||||
auto renderComponent = self->GetComponent<RenderComponent>();
|
||||
|
||||
if (renderComponent == nullptr) {
|
||||
return;
|
||||
@@ -27,7 +27,7 @@ void AgFans::ToggleFX(Entity* self, bool hit) {
|
||||
std::string fanGroup = self->GetGroups()[0];
|
||||
std::vector<Entity*> fanVolumes = EntityManager::Instance()->GetEntitiesInGroup(fanGroup);
|
||||
|
||||
auto* renderComponent = static_cast<RenderComponent*>(self->GetComponent(eReplicaComponentType::RENDER));
|
||||
auto renderComponent = self->GetComponent<RenderComponent>();
|
||||
|
||||
if (renderComponent == nullptr) {
|
||||
return;
|
||||
@@ -42,7 +42,7 @@ void AgFans::ToggleFX(Entity* self, bool hit) {
|
||||
self->SetVar<bool>(u"on", false);
|
||||
|
||||
for (Entity* volume : fanVolumes) {
|
||||
PhantomPhysicsComponent* volumePhys = static_cast<PhantomPhysicsComponent*>(volume->GetComponent(eReplicaComponentType::PHANTOM_PHYSICS));
|
||||
auto volumePhys = volume->GetComponent<PhantomPhysicsComponent>();
|
||||
if (!volumePhys) continue;
|
||||
volumePhys->SetPhysicsEffectActive(false);
|
||||
EntityManager::Instance()->SerializeEntity(volume);
|
||||
@@ -58,7 +58,7 @@ void AgFans::ToggleFX(Entity* self, bool hit) {
|
||||
self->SetVar<bool>(u"on", true);
|
||||
|
||||
for (Entity* volume : fanVolumes) {
|
||||
PhantomPhysicsComponent* volumePhys = static_cast<PhantomPhysicsComponent*>(volume->GetComponent(eReplicaComponentType::PHANTOM_PHYSICS));
|
||||
auto volumePhys = volume->GetComponent<PhantomPhysicsComponent>();
|
||||
if (!volumePhys) continue;
|
||||
volumePhys->SetPhysicsEffectActive(true);
|
||||
EntityManager::Instance()->SerializeEntity(volume);
|
||||
|
@@ -10,7 +10,7 @@ void AgImagSmashable::OnDie(Entity* self, Entity* killer) {
|
||||
bool maxImagGreaterThanZero = false;
|
||||
|
||||
if (killer) {
|
||||
DestroyableComponent* dest = static_cast<DestroyableComponent*>(killer->GetComponent(eReplicaComponentType::DESTROYABLE));
|
||||
auto dest = killer->GetComponent<DestroyableComponent>();
|
||||
if (dest) {
|
||||
maxImagGreaterThanZero = dest->GetMaxImagination() > 0;
|
||||
}
|
||||
|
@@ -49,7 +49,7 @@ void AgJetEffectServer::OnTimerDone(Entity* self, std::string timerName) {
|
||||
// so we give proper credit to the builder for the kills from this skill
|
||||
mortar->SetOwnerOverride(builder);
|
||||
|
||||
auto* skillComponent = mortar->GetComponent<SkillComponent>();
|
||||
auto skillComponent = mortar->GetComponent<SkillComponent>();
|
||||
if (skillComponent) skillComponent->CastSkill(318);
|
||||
} else if (timerName == "CineDone") {
|
||||
GameMessages::SendNotifyClientObject(
|
||||
|
@@ -2,7 +2,7 @@
|
||||
#include "MovingPlatformComponent.h"
|
||||
|
||||
void AgStagePlatforms::OnStartup(Entity* self) {
|
||||
auto* component = self->GetComponent<MovingPlatformComponent>();
|
||||
auto component = self->GetComponent<MovingPlatformComponent>();
|
||||
if (component) {
|
||||
component->SetNoAutoStart(true);
|
||||
component->StopPathing();
|
||||
@@ -10,7 +10,7 @@ void AgStagePlatforms::OnStartup(Entity* self) {
|
||||
}
|
||||
|
||||
void AgStagePlatforms::OnWaypointReached(Entity* self, uint32_t waypointIndex) {
|
||||
auto* component = self->GetComponent<MovingPlatformComponent>();
|
||||
auto component = self->GetComponent<MovingPlatformComponent>();
|
||||
if (waypointIndex == 0 && component)
|
||||
component->StopPathing();
|
||||
}
|
||||
|
Reference in New Issue
Block a user