mirror of
https://github.com/DarkflameUniverse/DarkflameServer.git
synced 2025-10-11 01:48:07 +00:00
feat: Add component ID to root component object (#1893)
This commit is contained in:
@@ -17,7 +17,7 @@ void WanderingVendor::OnProximityUpdate(Entity* self, Entity* entering, std::str
|
||||
self->CancelTimer("startWalking");
|
||||
} else if (status == "LEAVE") {
|
||||
auto* proximityMonitorComponent = self->GetComponent<ProximityMonitorComponent>();
|
||||
if (!proximityMonitorComponent) self->AddComponent<ProximityMonitorComponent>();
|
||||
if (!proximityMonitorComponent) self->AddComponent<ProximityMonitorComponent>(-1);
|
||||
|
||||
const auto proxObjs = proximityMonitorComponent->GetProximityObjects("playermonitor");
|
||||
bool foundPlayer = false;
|
||||
|
@@ -15,7 +15,7 @@ void NtFactionSpyServer::OnStartup(Entity* self) {
|
||||
// Set the proximity to sense later
|
||||
auto* proximityMonitor = self->GetComponent<ProximityMonitorComponent>();
|
||||
if (proximityMonitor == nullptr) {
|
||||
proximityMonitor = self->AddComponent<ProximityMonitorComponent>(-1, -1);
|
||||
proximityMonitor = self->AddComponent<ProximityMonitorComponent>(-1, -1, -1);
|
||||
}
|
||||
|
||||
proximityMonitor->SetProximityRadius(self->GetVar<float_t>(m_SpyProximityVariable), m_ProximityName);
|
||||
|
@@ -12,5 +12,5 @@ void AgStromlingProperty::OnStartup(Entity* self) {
|
||||
4
|
||||
};
|
||||
|
||||
self->AddComponent<MovementAIComponent>(movementInfo);
|
||||
self->AddComponent<MovementAIComponent>(-1, movementInfo);
|
||||
}
|
||||
|
@@ -273,7 +273,7 @@ void SGCannon::DoSpawnTimerFunc(Entity* self, const std::string& name) {
|
||||
|
||||
auto* enemy = Game::entityManager->CreateEntity(info, nullptr, self);
|
||||
|
||||
auto* movementAI = enemy->AddComponent<MovementAIComponent>(MovementAIInfo{});
|
||||
auto* movementAI = enemy->AddComponent<MovementAIComponent>(-1, MovementAIInfo{});
|
||||
auto* simplePhysicsComponent = enemy->GetComponent<SimplePhysicsComponent>();
|
||||
if (simplePhysicsComponent) {
|
||||
simplePhysicsComponent->SetPhysicsMotionState(4);
|
||||
|
Reference in New Issue
Block a user