From 61ad6e3a12cfc8db6b7b928e77d54bdf6776e121 Mon Sep 17 00:00:00 2001 From: past-due <30942300+past-due@users.noreply.github.com> Date: Sun, 11 Aug 2024 13:44:19 -0400 Subject: [PATCH 1/2] Additional psBuilding->sDisplay.imd checks --- src/structure.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/structure.cpp b/src/structure.cpp index fc81e9b9957..91e337bfb46 100644 --- a/src/structure.cpp +++ b/src/structure.cpp @@ -3791,7 +3791,8 @@ void structureUpdate(STRUCTURE *psBuilding, bool bMission) psBuilding->animationEvent = ANIM_EVENT_NONE; } else if (psBuilding->pFunctionality->resourceExtractor.psPowerGen - && psBuilding->animationEvent == ANIM_EVENT_NONE) // we have a power generator, but no animation + && psBuilding->animationEvent == ANIM_EVENT_NONE // we have a power generator, but no animation + && psBuilding->sDisplay.imd != nullptr) { psBuilding->animationEvent = ANIM_EVENT_ACTIVE; @@ -3935,7 +3936,7 @@ void structureUpdate(STRUCTURE *psBuilding, bool bMission) aDefaultRepair[psBuilding->player]].time); //add the blue flashing effect for multiPlayer - if (bMultiPlayer && ONEINTEN && !bMission) + if (bMultiPlayer && ONEINTEN && !bMission && psBuilding->sDisplay.imd) { Vector3i position; Vector3f *point; From d1c2e9fdfb185f59a63610563a18ba8f60403e98 Mon Sep 17 00:00:00 2001 From: past-due <30942300+past-due@users.noreply.github.com> Date: Sun, 11 Aug 2024 13:46:25 -0400 Subject: [PATCH 2/2] calcDroidMuzzleBaseLocation: Sanity check --- src/droid.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/droid.cpp b/src/droid.cpp index 185ba7158ab..ec4e25612be 100644 --- a/src/droid.cpp +++ b/src/droid.cpp @@ -2183,7 +2183,7 @@ bool calcDroidMuzzleBaseLocation(const DROID *psDroid, Vector3i *muzzle, int wea CHECK_DROID(psDroid); - if (psBodyImd && !psBodyImd->connectors.empty()) + if (psBodyImd && static_cast(weapon_slot) < psBodyImd->connectors.size()) { Vector3i barrel(0, 0, 0);