mirror of
https://github.com/DarkflameUniverse/DarkflameServer.git
synced 2025-10-09 00:48:04 +00:00
Organize Entity header
Probably the third or fourth pass of this darn header... Just keep making it better every time Rename some functions to make more sense to a reader Use different method for Observing/subscribing to component events Get rid of abomination of overloading GetParentUser
This commit is contained in:
@@ -3,7 +3,7 @@
|
||||
#include "Entity.h"
|
||||
|
||||
void ActPlayerDeathTrigger::OnCollisionPhantom(Entity* self, Entity* target) {
|
||||
if (!target->IsPlayer() || target->GetIsDead() || !target->GetPlayerReadyForUpdates()) return; //Don't kill already dead players or players not ready
|
||||
if (!target->IsPlayer() || target->IsDead() || !target->GetPlayerReadyForUpdates()) return; //Don't kill already dead players or players not ready
|
||||
|
||||
target->Smash(self->GetObjectID(), eKillType::SILENT);
|
||||
}
|
||||
|
@@ -11,7 +11,7 @@ void ActSharkPlayerDeathTrigger::OnFireEventServerSide(Entity* self, Entity* sen
|
||||
|
||||
missionComponent->Progress(eMissionTaskType::SCRIPT, 8419);
|
||||
|
||||
if (sender->GetIsDead() || !sender->GetPlayerReadyForUpdates()) return; //Don't kill already dead players or players not ready
|
||||
if (sender->IsDead() || !sender->GetPlayerReadyForUpdates()) return; //Don't kill already dead players or players not ready
|
||||
|
||||
if (sender->GetCharacter()) {
|
||||
sender->Smash(self->GetObjectID(), eKillType::VIOLENT, u"big-shark-death");
|
||||
|
@@ -2,7 +2,7 @@
|
||||
#include "Entity.h"
|
||||
|
||||
void AgShipPlayerDeathTrigger::OnCollisionPhantom(Entity* self, Entity* target) {
|
||||
if (target->GetLOT() == 1 && !target->GetIsDead()) {
|
||||
if (target->GetLOT() == 1 && !target->IsDead()) {
|
||||
target->Smash(self->GetObjectID(), eKillType::VIOLENT, u"electro-shock-death");
|
||||
}
|
||||
}
|
||||
|
@@ -28,7 +28,7 @@ void TriggerGas::OnTimerDone(Entity* self, std::string timerName) {
|
||||
if (timerName != this->m_TimerName) return;
|
||||
auto players = self->GetVar<std::vector<Entity*>>(u"players");
|
||||
for (auto player : players) {
|
||||
if (player->GetIsDead() || !player){
|
||||
if (player->IsDead() || !player){
|
||||
auto position = std::find(players.begin(), players.end(), player);
|
||||
if (position != players.end()) players.erase(position);
|
||||
continue;
|
||||
|
@@ -45,7 +45,7 @@ void PetDigBuild::OnDie(Entity* self, Entity* killer) {
|
||||
return;
|
||||
|
||||
// If the quick build expired and the treasure was not collected, hide the treasure
|
||||
if (!treasure->GetIsDead()) {
|
||||
if (!treasure->IsDead()) {
|
||||
treasure->Smash(self->GetObjectID(), eKillType::SILENT);
|
||||
}
|
||||
}
|
||||
|
@@ -27,7 +27,7 @@ void NsConcertInstrument::OnRebuildNotifyState(Entity* self, eRebuildState state
|
||||
}
|
||||
|
||||
void NsConcertInstrument::OnRebuildComplete(Entity* self, Entity* target) {
|
||||
if (!target->GetIsDead()) {
|
||||
if (!target->IsDead()) {
|
||||
self->SetVar<LWOOBJID>(u"activePlayer", target->GetObjectID());
|
||||
|
||||
self->AddCallbackTimer(0.2f, [self, target]() {
|
||||
|
Reference in New Issue
Block a user