mirror of
https://github.com/DarkflameUniverse/DarkflameServer.git
synced 2024-11-14 12:18:22 +00:00
16 lines
562 B
C++
16 lines
562 B
C++
#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) {
|
|
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");
|
|
}
|
|
}
|