Skip to content

Commit

Permalink
fix: adding a proximity monitor when one exists already (#1235)
Browse files Browse the repository at this point in the history
  • Loading branch information
aronwk-aaron authored Oct 23, 2023
1 parent 9aa81f9 commit aab6056
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion dGame/Entity.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -827,7 +827,8 @@ void Entity::Unsubscribe(LWOOBJID scriptObjId, const std::string& notificationNa
}

void Entity::SetProximityRadius(float proxRadius, std::string name) {
ProximityMonitorComponent* proxMon = AddComponent<ProximityMonitorComponent>();
auto* proxMon = GetComponent<ProximityMonitorComponent>();
if (!proxMon) proxMon = AddComponent<ProximityMonitorComponent>();
proxMon->SetProximityRadius(proxRadius, name);
}

Expand Down

0 comments on commit aab6056

Please sign in to comment.