Skip to content

Commit 8b12e27

Browse files
authored
[GEN][ZH] Fix World Builder crashing on drawing scene, introduced by previous change #1146 (#1184)
1 parent 61cbc6f commit 8b12e27

File tree

2 files changed

+4
-4
lines changed
  • GeneralsMD/Code/GameEngineDevice/Source/W3DDevice/GameClient
  • Generals/Code/GameEngineDevice/Source/W3DDevice/GameClient

2 files changed

+4
-4
lines changed

Generals/Code/GameEngineDevice/Source/W3DDevice/GameClient/W3DScene.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -399,7 +399,7 @@ void RTS3DScene::Visibility_Check(CameraClass * camera)
399399
m_translucentObjectsCount=0;
400400
m_numNonOccluderOrOccludee=0;
401401

402-
Int currentFrame=TheGameLogic->getFrame();
402+
Int currentFrame = TheGameLogic ? TheGameLogic->getFrame() : 0;
403403
if (currentFrame <= TheGlobalData->m_defaultOcclusionDelay)
404404
currentFrame = TheGlobalData->m_defaultOcclusionDelay+1; //make sure occlusion is enabled when game starts (frame 0).
405405

@@ -471,7 +471,7 @@ void RTS3DScene::Visibility_Check(CameraClass * camera)
471471
m_translucentObjectsBuffer[m_translucentObjectsCount++] = robj;
472472
}
473473
else
474-
if (TheGlobalData->m_enableBehindBuildingMarkers && TheGameLogic->getShowBehindBuildingMarkers())
474+
if (TheGlobalData->m_enableBehindBuildingMarkers && TheGameLogic && TheGameLogic->getShowBehindBuildingMarkers())
475475
{
476476
//visible drawable. Check if it's either an occluder or occludee
477477
if (draw->isKindOf(KINDOF_STRUCTURE) && m_numPotentialOccluders < TheGlobalData->m_maxVisibleOccluderObjects)

GeneralsMD/Code/GameEngineDevice/Source/W3DDevice/GameClient/W3DScene.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -415,7 +415,7 @@ void RTS3DScene::Visibility_Check(CameraClass * camera)
415415
m_translucentObjectsCount=0;
416416
m_numNonOccluderOrOccludee=0;
417417

418-
Int currentFrame=TheGameLogic->getFrame();
418+
Int currentFrame = TheGameLogic ? TheGameLogic->getFrame() : 0;
419419
if (currentFrame <= TheGlobalData->m_defaultOcclusionDelay)
420420
currentFrame = TheGlobalData->m_defaultOcclusionDelay+1; //make sure occlusion is enabled when game starts (frame 0).
421421

@@ -490,7 +490,7 @@ void RTS3DScene::Visibility_Check(CameraClass * camera)
490490
{ drawInfo->m_flags |= DrawableInfo::ERF_IS_TRANSLUCENT; //object is translucent
491491
m_translucentObjectsBuffer[m_translucentObjectsCount++] = robj;
492492
}
493-
if (TheGlobalData->m_enableBehindBuildingMarkers && TheGameLogic->getShowBehindBuildingMarkers())
493+
if (TheGlobalData->m_enableBehindBuildingMarkers && TheGameLogic && TheGameLogic->getShowBehindBuildingMarkers())
494494
{
495495
//visible drawable. Check if it's either an occluder or occludee
496496
if (draw->isKindOf(KINDOF_STRUCTURE) && m_numPotentialOccluders < TheGlobalData->m_maxVisibleOccluderObjects)

0 commit comments

Comments
 (0)