DarkflameServer/dScripts/AgMonumentRaceGoal.cpp

16 lines
496 B
C++
Raw Permalink Normal View History

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