mirror of
https://github.com/DarkflameUniverse/DarkflameServer.git
synced 2024-11-12 19:28:21 +00:00
add bounds check to prevent crashing (#992)
This commit is contained in:
parent
72c93c8913
commit
484488e47d
@ -7,9 +7,9 @@ void AgMonumentRaceGoal::OnStartup(Entity* self) {
|
||||
}
|
||||
|
||||
void AgMonumentRaceGoal::OnProximityUpdate(Entity* self, Entity* entering, std::string name, std::string status) {
|
||||
if (name == "RaceGoal" && entering->IsPlayer() && status == "ENTER") {
|
||||
auto* manager = EntityManager::Instance()->GetEntitiesInGroup("race_manager")[0];
|
||||
|
||||
manager->OnFireEventServerSide(entering, "course_finish");
|
||||
if (name == "RaceGoal" && entering && entering->IsPlayer() && status == "ENTER") {
|
||||
auto managers = EntityManager::Instance()->GetEntitiesInGroup("race_manager");
|
||||
if (managers.empty() || !managers.at(0)) return;
|
||||
managers.at(0)->OnFireEventServerSide(entering, "course_finish");
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user