2021-12-05 17:54:36 +00:00
|
|
|
#include "AgMonumentRaceGoal.h"
|
|
|
|
#include "EntityManager.h"
|
|
|
|
|
|
|
|
|
|
|
|
void AgMonumentRaceGoal::OnStartup(Entity* self) {
|
|
|
|
self->SetProximityRadius(15, "RaceGoal");
|
|
|
|
}
|
|
|
|
|
|
|
|
void AgMonumentRaceGoal::OnProximityUpdate(Entity* self, Entity* entering, std::string name, std::string status) {
|
2023-02-16 17:14:23 +00:00
|
|
|
if (name == "RaceGoal" && entering && entering->IsPlayer() && status == "ENTER") {
|
2023-07-15 20:56:33 +00:00
|
|
|
auto managers = Game::entityManager->GetEntitiesInGroup("race_manager");
|
2023-02-16 17:14:23 +00:00
|
|
|
if (managers.empty() || !managers.at(0)) return;
|
|
|
|
managers.at(0)->OnFireEventServerSide(entering, "course_finish");
|
2021-12-05 17:54:36 +00:00
|
|
|
}
|
|
|
|
}
|