Skip to content

Commit

Permalink
Fix some style
Browse files Browse the repository at this point in the history
  • Loading branch information
TheNormalnij committed Apr 28, 2024
1 parent 4569a72 commit 17eb1a8
Showing 1 changed file with 7 additions and 16 deletions.
23 changes: 7 additions & 16 deletions Client/game_sa/CBuildingsPoolSA.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,12 @@ void CBuildingsPoolSA::RemoveBuilding(CBuilding* pBuilding)
if (dwElementIndexInPool == UINT_MAX)
return;

// Remove building from cover list
pGame->GetCoverManager()->RemoveCover(pInterface);

// Remove plant
pGame->GetPlantManager()->RemovePlant(pInterface);

RemoveBuildingFromWorld(pInterface);

// Remove col reference
Expand Down Expand Up @@ -136,16 +142,7 @@ void CBuildingsPoolSA::RemoveAllBuildings()
{
CBuildingSAInterface* building = pBuildsingsPool->GetObject(i);

//RemoveBuildingFromWorld(building);

pGame->GetWorld()->Remove(building, CBuildingPool_Destructor);

CEntitySA entity{};
entity.SetInterface(building);
entity.DeleteRwObject();

using CEntity_ResolveReferences = void*(__thiscall*)(CEntitySAInterface*);
((CEntity_ResolveReferences)0x571A40)(building);
RemoveBuildingFromWorld(building);

pBuildsingsPool->Release(i);

Expand Down Expand Up @@ -186,12 +183,6 @@ void CBuildingsPoolSA::RemoveBuildingFromWorld(CBuildingSAInterface* pBuilding)
// Remove building from world
pGame->GetWorld()->Remove(pBuilding, CBuildingPool_Destructor);

// Remove building from cover list
pGame->GetCoverManager()->RemoveCover(pBuilding);

// Remove plant
pGame->GetPlantManager()->RemovePlant(pBuilding);

CEntitySA entity{};
entity.SetInterface(pBuilding);
entity.DeleteRwObject();
Expand Down

0 comments on commit 17eb1a8

Please sign in to comment.