mirror of
https://github.com/DarkflameUniverse/DarkflameServer.git
synced 2025-08-08 11:44:11 +00:00
Merge branch 'main' into pr/1107
This commit is contained in:
@@ -195,7 +195,7 @@ void BaseWavesServer::OnActivityTimerDone(Entity* self, const std::string& name)
|
||||
ActivityTimerStart(self, PlaySpawnSoundTimer, 3, 3);
|
||||
} else if (name == PlaySpawnSoundTimer) {
|
||||
for (const auto& playerID : state.players) {
|
||||
auto* player = EntityManager::Instance()->GetEntity(playerID);
|
||||
auto* player = Game::entityManager->GetEntity(playerID);
|
||||
if (player != nullptr) {
|
||||
GameMessages::SendPlayNDAudioEmitter(player, player->GetSystemAddress(), spawnSoundGUID);
|
||||
}
|
||||
@@ -216,7 +216,7 @@ void BaseWavesServer::OnActivityTimerDone(Entity* self, const std::string& name)
|
||||
} else if (name == GameOverWinTimer) {
|
||||
GameOver(self, true);
|
||||
} else if (name == CinematicDoneTimer) {
|
||||
for (auto* boss : EntityManager::Instance()->GetEntitiesInGroup("boss")) {
|
||||
for (auto* boss : Game::entityManager->GetEntitiesInGroup("boss")) {
|
||||
boss->OnFireEventServerSide(self, "startAI");
|
||||
}
|
||||
}
|
||||
@@ -224,7 +224,7 @@ void BaseWavesServer::OnActivityTimerDone(Entity* self, const std::string& name)
|
||||
|
||||
// Done
|
||||
void BaseWavesServer::ResetStats(LWOOBJID playerID) {
|
||||
auto* player = EntityManager::Instance()->GetEntity(playerID);
|
||||
auto* player = Game::entityManager->GetEntity(playerID);
|
||||
if (player != nullptr) {
|
||||
|
||||
// Boost all the player stats when loading in
|
||||
@@ -284,7 +284,7 @@ void BaseWavesServer::StartWaves(Entity* self) {
|
||||
state.waitingPlayers.clear();
|
||||
|
||||
for (const auto& playerID : state.players) {
|
||||
const auto player = EntityManager::Instance()->GetEntity(playerID);
|
||||
const auto player = Game::entityManager->GetEntity(playerID);
|
||||
if (player != nullptr) {
|
||||
state.waitingPlayers.push_back(playerID);
|
||||
|
||||
@@ -309,7 +309,7 @@ bool BaseWavesServer::CheckAllPlayersDead() {
|
||||
auto deadPlayers = 0;
|
||||
|
||||
for (const auto& playerID : state.players) {
|
||||
auto* player = EntityManager::Instance()->GetEntity(playerID);
|
||||
auto* player = Game::entityManager->GetEntity(playerID);
|
||||
if (player == nullptr || player->GetIsDead()) {
|
||||
deadPlayers++;
|
||||
}
|
||||
@@ -322,9 +322,9 @@ bool BaseWavesServer::CheckAllPlayersDead() {
|
||||
void BaseWavesServer::SetPlayerSpawnPoints(const LWOOBJID& specificPlayerID) {
|
||||
auto spawnerIndex = 1;
|
||||
for (const auto& playerID : state.players) {
|
||||
auto* player = EntityManager::Instance()->GetEntity(playerID);
|
||||
auto* player = Game::entityManager->GetEntity(playerID);
|
||||
if (player != nullptr && (specificPlayerID == LWOOBJID_EMPTY || playerID == specificPlayerID)) {
|
||||
auto possibleSpawners = EntityManager::Instance()->GetEntitiesInGroup("P" + std::to_string(spawnerIndex) + "_Spawn");
|
||||
auto possibleSpawners = Game::entityManager->GetEntitiesInGroup("P" + std::to_string(spawnerIndex) + "_Spawn");
|
||||
if (!possibleSpawners.empty()) {
|
||||
auto* spawner = possibleSpawners.at(0);
|
||||
GameMessages::SendTeleport(playerID, spawner->GetPosition(), spawner->GetRotation(), player->GetSystemAddress(), true);
|
||||
@@ -353,7 +353,7 @@ void BaseWavesServer::GameOver(Entity* self, bool won) {
|
||||
ClearSpawners();
|
||||
|
||||
for (const auto& playerID : state.players) {
|
||||
auto* player = EntityManager::Instance()->GetEntity(playerID);
|
||||
auto* player = Game::entityManager->GetEntity(playerID);
|
||||
if (player == nullptr)
|
||||
continue;
|
||||
|
||||
@@ -430,7 +430,7 @@ void BaseWavesServer::SpawnWave(Entity* self) {
|
||||
}
|
||||
|
||||
for (const auto& playerID : state.players) {
|
||||
auto* player = EntityManager::Instance()->GetEntity(playerID);
|
||||
auto* player = Game::entityManager->GetEntity(playerID);
|
||||
if (player && player->GetIsDead()) {
|
||||
player->Resurrect();
|
||||
}
|
||||
@@ -472,7 +472,7 @@ bool BaseWavesServer::UpdateSpawnedEnemies(Entity* self, LWOOBJID enemyID, uint3
|
||||
|
||||
state.currentSpawned--;
|
||||
|
||||
auto* enemy = EntityManager::Instance()->GetEntity(enemyID);
|
||||
auto* enemy = Game::entityManager->GetEntity(enemyID);
|
||||
if (enemy != nullptr && enemy->IsPlayer() && IsPlayerInActivity(self, enemyID)) {
|
||||
SetActivityValue(self, enemyID, 0, GetActivityValue(self, enemyID, 0) + score);
|
||||
}
|
||||
@@ -500,7 +500,7 @@ bool BaseWavesServer::UpdateSpawnedEnemies(Entity* self, LWOOBJID enemyID, uint3
|
||||
const auto soloWaveMissions = waves.at(completedWave).soloMissions;
|
||||
|
||||
for (const auto& playerID : state.players) {
|
||||
auto* player = EntityManager::Instance()->GetEntity(playerID);
|
||||
auto* player = Game::entityManager->GetEntity(playerID);
|
||||
if (player != nullptr && !player->GetIsDead()) {
|
||||
SetActivityValue(self, playerID, 1, currentTime);
|
||||
SetActivityValue(self, playerID, 2, state.waveNumber);
|
||||
@@ -559,7 +559,7 @@ bool BaseWavesServer::UpdateSpawnedEnemies(Entity* self, LWOOBJID enemyID, uint3
|
||||
// Done
|
||||
void BaseWavesServer::UpdateMissionForAllPlayers(Entity* self, uint32_t missionID) {
|
||||
for (const auto& playerID : state.players) {
|
||||
auto* player = EntityManager::Instance()->GetEntity(playerID);
|
||||
auto* player = Game::entityManager->GetEntity(playerID);
|
||||
if (player != nullptr) {
|
||||
auto* missionComponent = player->GetComponent<MissionComponent>();
|
||||
if (missionComponent == nullptr) return;
|
||||
|
Reference in New Issue
Block a user