Script: Fix unupdated new component (#1236)

This commit is contained in:
David Markowitz 2023-10-23 13:25:07 -07:00 committed by GitHub
parent aab60567ba
commit 025ff593ce
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -15,7 +15,7 @@ void NtFactionSpyServer::OnStartup(Entity* self) {
// Set the proximity to sense later // Set the proximity to sense later
auto* proximityMonitor = self->GetComponent<ProximityMonitorComponent>(); auto* proximityMonitor = self->GetComponent<ProximityMonitorComponent>();
if (proximityMonitor == nullptr) { if (proximityMonitor == nullptr) {
self->AddComponent<ProximityMonitorComponent>(-1, -1); proximityMonitor = self->AddComponent<ProximityMonitorComponent>(-1, -1);
} }
proximityMonitor->SetProximityRadius(self->GetVar<float_t>(m_SpyProximityVariable), m_ProximityName); proximityMonitor->SetProximityRadius(self->GetVar<float_t>(m_SpyProximityVariable), m_ProximityName);