summaryrefslogtreecommitdiff
path: root/src/control/Script4.cpp
diff options
context:
space:
mode:
authorNikolay Korolev <nickvnuk@gmail.com>2021-07-25 21:44:21 +0300
committerNikolay Korolev <nickvnuk@gmail.com>2021-07-25 21:44:21 +0300
commitbf4b39781ba64076c06e00825277a6c7f67c0949 (patch)
tree7a5bb0cbbbd0b58f168cfd9b792a74d78d039eee /src/control/Script4.cpp
parent1619d2395eb1ead70d562f6777b1a203040ce1a3 (diff)
low effort save support
Diffstat (limited to 'src/control/Script4.cpp')
-rw-r--r--src/control/Script4.cpp6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/control/Script4.cpp b/src/control/Script4.cpp
index d5edc5cf..7ff785d5 100644
--- a/src/control/Script4.cpp
+++ b/src/control/Script4.cpp
@@ -2262,8 +2262,10 @@ void CTheScripts::SwapNearestBuildingModel(float x, float y, float z, float radi
}
}
CBuilding* pReplacedBuilding = ((CBuilding*)pClosestEntity);
- pReplacedBuilding->ReplaceWithNewModel(mi2);
- AddToBuildingSwapArray(pReplacedBuilding, mi1, mi2);
+ if (pReplacedBuilding) {
+ pReplacedBuilding->ReplaceWithNewModel(mi2);
+ AddToBuildingSwapArray(pReplacedBuilding, mi1, mi2);
+ }
}
void CTheScripts::AddToBuildingSwapArray(CBuilding* pBuilding, int32 old_model, int32 new_model)