mirror of
https://github.com/DarkflameUniverse/DarkflameServer.git
synced 2025-08-04 09:44:10 +00:00
Remove multiple Script syntax (#1496)
This commit is contained in:
@@ -1,5 +1,6 @@
|
||||
#include "NtCombatChallengeDummy.h"
|
||||
#include "EntityManager.h"
|
||||
#include "Entity.h"
|
||||
|
||||
void NtCombatChallengeDummy::OnDie(Entity* self, Entity* killer) {
|
||||
const auto challengeObjectID = self->GetVar<LWOOBJID>(u"challengeObjectID");
|
||||
@@ -7,9 +8,7 @@ void NtCombatChallengeDummy::OnDie(Entity* self, Entity* killer) {
|
||||
auto* challengeObject = Game::entityManager->GetEntity(challengeObjectID);
|
||||
|
||||
if (challengeObject != nullptr) {
|
||||
for (CppScripts::Script* script : CppScripts::GetEntityScripts(challengeObject)) {
|
||||
script->OnDie(challengeObject, killer);
|
||||
}
|
||||
challengeObject->GetScript()->OnDie(challengeObject, killer);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -19,8 +18,6 @@ void NtCombatChallengeDummy::OnHitOrHealResult(Entity* self, Entity* attacker, i
|
||||
auto* challengeObject = Game::entityManager->GetEntity(challengeObjectID);
|
||||
|
||||
if (challengeObject != nullptr) {
|
||||
for (CppScripts::Script* script : CppScripts::GetEntityScripts(challengeObject)) {
|
||||
script->OnHitOrHealResult(challengeObject, attacker, damage);
|
||||
}
|
||||
challengeObject->GetScript()->OnHitOrHealResult(challengeObject, attacker, damage);
|
||||
}
|
||||
}
|
||||
|
@@ -9,9 +9,7 @@ void NtCombatChallengeExplodingDummy::OnDie(Entity* self, Entity* killer) {
|
||||
auto* challengeObject = Game::entityManager->GetEntity(challengeObjectID);
|
||||
|
||||
if (challengeObject != nullptr) {
|
||||
for (CppScripts::Script* script : CppScripts::GetEntityScripts(challengeObject)) {
|
||||
script->OnDie(challengeObject, killer);
|
||||
}
|
||||
challengeObject->GetScript()->OnDie(challengeObject, killer);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -32,9 +30,7 @@ void NtCombatChallengeExplodingDummy::OnHitOrHealResult(Entity* self, Entity* at
|
||||
auto* challengeObject = Game::entityManager->GetEntity(challengeObjectID);
|
||||
|
||||
if (challengeObject != nullptr) {
|
||||
for (CppScripts::Script* script : CppScripts::GetEntityScripts(challengeObject)) {
|
||||
script->OnHitOrHealResult(challengeObject, attacker, damage);
|
||||
}
|
||||
challengeObject->GetScript()->OnHitOrHealResult(challengeObject, attacker, damage);
|
||||
}
|
||||
auto skillComponent = self->GetComponent<SkillComponent>();
|
||||
if (skillComponent != nullptr) {
|
||||
|
Reference in New Issue
Block a user