DarkflameServer/dScripts/EquipmentScripts/StunImmunity.cpp
David Markowitz e2dfa1809d Replace all auto with auto*
For components
2023-06-09 01:27:05 -07:00

21 lines
658 B
C++

#include "StunImmunity.h"
#include "DestroyableComponent.h"
#include "ControllablePhysicsComponent.h"
#include "eStateChangeType.h"
void StunImmunity::OnStartup(Entity* self) {
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>();
if (controllablePhysicsComponent) {
controllablePhysicsComponent->SetStunImmunity(
eStateChangeType::PUSH, self->GetObjectID(), true
);
}
}