Skip to content

Commit

Permalink
<GetGlobalDockScreen> does not automatically create docking ports
Browse files Browse the repository at this point in the history
  • Loading branch information
gmoromisato committed Mar 3, 2020
1 parent b8fbcb5 commit 3e468a5
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions Mammoth/TSE/CSpaceObject.cpp
Expand Up @@ -4516,6 +4516,17 @@ bool CSpaceObject::HasDockScreen (void) const
&& pOverlays->FireGetDockScreen(this))
return true;

// If we don't have any docking screens so far (not even from overlays) and
// if we don't have any docking ports, then don't bother calling
// <GetGlobalDockScreen>. The performance hit of calling these global
// events at create time (e.g., on asteroids) is too much.

if (const CDockingPorts *pDockingPorts = GetDockingPorts())
{
if (pDockingPorts->GetPortCount() == 0)
return false;
}

// If we still have no screens, we call <GetGlobalDockScreen>, but we're
// only interested in non-override screens. Override screens are screens
// like decontamination screens, which should only show up if the station
Expand Down

0 comments on commit 3e468a5

Please sign in to comment.