2021-12-05 17:54:36 +00:00
|
|
|
#include "AgMonumentRaceGoal.h"
|
|
|
|
#include "EntityManager.h"
|
|
|
|
|
|
|
|
|
2022-07-28 13:39:57 +00:00
|
|
|
void AgMonumentRaceGoal::OnStartup(Entity* self) {
|
|
|
|
self->SetProximityRadius(15, "RaceGoal");
|
2021-12-05 17:54:36 +00:00
|
|
|
}
|
|
|
|
|
2022-07-28 13:39:57 +00:00
|
|
|
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];
|
2021-12-05 17:54:36 +00:00
|
|
|
|
2022-07-28 13:39:57 +00:00
|
|
|
manager->OnFireEventServerSide(entering, "course_finish");
|
|
|
|
}
|
2021-12-05 17:54:36 +00:00
|
|
|
}
|