mirror of
https://github.com/DarkflameUniverse/DarkflameServer.git
synced 2025-06-11 04:35:39 +00:00
fix: destroy enemies on entering build mode (#1812)
This commit is contained in:
parent
37e14979a4
commit
2858345269
@ -272,6 +272,10 @@ void PropertyManagementComponent::OnStartBuilding() {
|
||||
model->HandleMsg(reset);
|
||||
}
|
||||
}
|
||||
|
||||
for (auto* const entity : Game::entityManager->GetEntitiesInGroup("SpawnedPropertyEnemies")) {
|
||||
if (entity) entity->Smash();
|
||||
}
|
||||
}
|
||||
|
||||
void PropertyManagementComponent::OnFinishBuilding() {
|
||||
@ -296,6 +300,10 @@ void PropertyManagementComponent::OnFinishBuilding() {
|
||||
model->HandleMsg(reset);
|
||||
}
|
||||
}
|
||||
|
||||
for (auto* const entity : Game::entityManager->GetEntitiesInGroup("SpawnedPropertyEnemies")) {
|
||||
if (entity) entity->Smash();
|
||||
}
|
||||
}
|
||||
|
||||
void PropertyManagementComponent::UpdateModelPosition(const LWOOBJID id, const NiPoint3 position, NiQuaternion rotation) {
|
||||
|
@ -111,7 +111,9 @@ void Strip::Spawn(LOT lot, Entity& entity) {
|
||||
info.pos = entity.GetPosition();
|
||||
info.rot = NiQuaternionConstant::IDENTITY;
|
||||
info.spawnerID = entity.GetObjectID();
|
||||
Game::entityManager->ConstructEntity(Game::entityManager->CreateEntity(info, nullptr, &entity));
|
||||
auto* const spawnedEntity = Game::entityManager->CreateEntity(info, nullptr, &entity);
|
||||
spawnedEntity->AddToGroup("SpawnedPropertyEnemies");
|
||||
Game::entityManager->ConstructEntity(spawnedEntity);
|
||||
}
|
||||
|
||||
// Spawns a specific drop for all
|
||||
|
Loading…
x
Reference in New Issue
Block a user