Skip to content

Commit 25fef26

Browse files
committed
Conquest crash "fix" - make SceneMan::GetTerrMatter return air material instead of crashing if there's no terrain bitmap
1 parent 2d9e66a commit 25fef26

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

Managers/SceneMan.cpp

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -479,6 +479,9 @@ unsigned char SceneMan::GetTerrMatter(int pixelX, int pixelY)
479479
if (m_pDebugLayer && m_DrawPixelCheckVisualizations) { m_pDebugLayer->SetPixel(pixelX, pixelY, 5); }
480480

481481
BITMAP *pTMatBitmap = m_pCurrentScene->GetTerrain()->GetMaterialBitmap();
482+
if (pTMatBitmap == nullptr) {
483+
return g_MaterialAir;
484+
}
482485

483486
// If it's still below or to the sides out of bounds after
484487
// what is supposed to be wrapped, shit is out of bounds.

0 commit comments

Comments
 (0)