Fix dead pointer usage on factory destruction during secondary order editing of said factory.
Right-clicking a factory just before it's destroyed no longer crashes.master
parent
2249996f1c
commit
aaf0fb8798
|
@ -976,6 +976,11 @@ void intRunOrder(void)
|
|||
// Remove any NULL pointers from SelectedDroids.
|
||||
SelectedDroids.erase(std::remove(SelectedDroids.begin(), SelectedDroids.end(), (DROID *)NULL), SelectedDroids.end());
|
||||
|
||||
if (psSelectedFactory != NULL && psSelectedFactory->died)
|
||||
{
|
||||
psSelectedFactory = NULL;
|
||||
}
|
||||
|
||||
// If all dead then remove the screen.
|
||||
// If droids no longer selected then remove screen.
|
||||
if (SelectedDroids.empty())
|
||||
|
|
Loading…
Reference in New Issue