mirror of
https://github.com/DarkflameUniverse/DarkflameServer.git
synced 2025-12-19 19:20:13 +00:00
Move to new branch
Added comments Added some comments and changed a variable name to be less ambiguous.
This commit is contained in:
@@ -13,6 +13,7 @@
|
||||
#include "dZoneManager.h"
|
||||
#include "CharacterComponent.h"
|
||||
#include "Mail.h"
|
||||
#include "CppScripts.h"
|
||||
|
||||
std::vector<Player*> Player::m_Players = {};
|
||||
|
||||
@@ -329,5 +330,21 @@ Player::~Player()
|
||||
return;
|
||||
}
|
||||
|
||||
if (IsPlayer()) {
|
||||
Entity* zoneControl = EntityManager::Instance()->GetZoneControlEntity();
|
||||
for (CppScripts::Script* script : CppScripts::GetEntityScripts(zoneControl)) {
|
||||
script->OnPlayerExit(zoneControl, this);
|
||||
}
|
||||
|
||||
std::vector<Entity*> scriptedActs = EntityManager::Instance()->GetEntitiesByComponent(COMPONENT_TYPE_SCRIPTED_ACTIVITY);
|
||||
for (Entity* scriptEntity : scriptedActs) {
|
||||
if (scriptEntity->GetObjectID() != zoneControl->GetObjectID()) { // Don't want to trigger twice on instance worlds
|
||||
for (CppScripts::Script* script : CppScripts::GetEntityScripts(scriptEntity)) {
|
||||
script->OnPlayerExit(scriptEntity, this);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
m_Players.erase(iter);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user