Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,10 @@ void MissileLauncherBuildingUpdate::switchToState(DoorStateType dst)
return;

const MissileLauncherBuildingUpdateModuleData* d = getMissileLauncherBuildingUpdateModuleData();

// Safety check: if the module data has been cleared during destruction, don't proceed
if (!d)
return;
ModelConditionFlags clr, set;
UnsignedInt now = TheGameLogic->getFrame();
switch (dst)
Expand Down Expand Up @@ -229,6 +233,10 @@ UpdateSleepTime MissileLauncherBuildingUpdate::update( void )
return UPDATE_SLEEP_NONE;

const MissileLauncherBuildingUpdateModuleData* d = getMissileLauncherBuildingUpdateModuleData();

// Safety check: if the module data has been cleared during destruction, don't proceed
if (!d)
return UPDATE_SLEEP_NONE;

UnsignedInt now = TheGameLogic->getFrame();

Expand Down Expand Up @@ -275,6 +283,11 @@ UpdateSleepTime MissileLauncherBuildingUpdate::update( void )
SpecialPowerTemplate* MissileLauncherBuildingUpdate::getTemplate() const
{
const MissileLauncherBuildingUpdateModuleData* data = getMissileLauncherBuildingUpdateModuleData();

// Safety check: if the module data has been cleared during destruction, return NULL
if (!data)
return NULL;

return data->m_specialPowerTemplate;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,10 @@ void MissileLauncherBuildingUpdate::switchToState(DoorStateType dst)
return;

const MissileLauncherBuildingUpdateModuleData* d = getMissileLauncherBuildingUpdateModuleData();

// Safety check: if the module data has been cleared during destruction, don't proceed
if (!d)
return;
ModelConditionFlags clr, set;
UnsignedInt now = TheGameLogic->getFrame();
switch (dst)
Expand Down Expand Up @@ -245,6 +249,10 @@ UpdateSleepTime MissileLauncherBuildingUpdate::update( void )
return UPDATE_SLEEP_NONE;

const MissileLauncherBuildingUpdateModuleData* d = getMissileLauncherBuildingUpdateModuleData();

// Safety check: if the module data has been cleared during destruction, don't proceed
if (!d)
return UPDATE_SLEEP_NONE;

UnsignedInt now = TheGameLogic->getFrame();

Expand Down Expand Up @@ -291,6 +299,11 @@ UpdateSleepTime MissileLauncherBuildingUpdate::update( void )
SpecialPowerTemplate* MissileLauncherBuildingUpdate::getTemplate() const
{
const MissileLauncherBuildingUpdateModuleData* data = getMissileLauncherBuildingUpdateModuleData();

// Safety check: if the module data has been cleared during destruction, return NULL
if (!data)
return NULL;

return data->m_specialPowerTemplate;
}

Expand Down
Loading