Skip to content

Commit e165f6d

Browse files
committed
Crashfix
1 parent 359ba7a commit e165f6d

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

Client/game_sa/CWorldSA.cpp

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -275,7 +275,13 @@ auto CWorldSA::ProcessLineAgainstMesh(CEntitySAInterface* targetEntity, CVector
275275
}
276276

277277
// Get matrix, and it's inverse
278-
c.entity->matrix->ConvertToMatrix(c.entMat);
278+
if (c.entity->matrix)
279+
c.entity->matrix->ConvertToMatrix(c.entMat);
280+
else
281+
{
282+
c.entMat.SetPosition(c.entity->m_transform.m_translate);
283+
c.entMat.SetRotation(CVector{0.0f, 0.0f, c.entity->m_transform.m_heading});
284+
}
279285
c.entInvMat = c.entMat.Inverse();
280286

281287
// ...to transform the line origin and end into object space

0 commit comments

Comments
 (0)