Skip to content

Commit dc3bc23

Browse files
committed
Add description
1 parent 400d78d commit dc3bc23

File tree

1 file changed

+9
-4
lines changed

1 file changed

+9
-4
lines changed

Client/game_sa/CBuildingsPoolSA.cpp

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -96,13 +96,18 @@ CBuilding* CBuildingsPoolSA::AddBuilding(CClientBuilding* pClientBuilding, uint1
9696
// Add building in world
9797
auto pBuildingSA = new CBuildingSA(pBuilding);
9898

99-
// Edge case for the traincross2 (1374) model
10099
if (pBuilding->HasMatrix())
100+
{
101+
// Edge case for the traincross2 (1374) model
102+
// LoadObjectInstance allocates a matrix for the model
103+
// We need allocate our own matrix and put the old matrix in the original pool
101104
pBuildingSA->ReallocateMatrix();
102-
103-
// Set rotation
104-
if (vRot->fX != 0 || vRot->fY != 0)
105+
}
106+
else if (vRot->fX != 0 || vRot->fY != 0)
107+
{
108+
// Allocate matrix in our unlimited storage instead of using the shared pool.
105109
pBuildingSA->AllocateMatrix();
110+
}
106111

107112
pBuilding->SetOrientation(vRot->fX, vRot->fY, vRot->fZ);
108113

0 commit comments

Comments
 (0)