diff --git a/docs/Whats-New.md b/docs/Whats-New.md index b40c28886b..89ab0c093f 100644 --- a/docs/Whats-New.md +++ b/docs/Whats-New.md @@ -505,6 +505,7 @@ Phobos fixes: - Fixed an interaction error between the engineer and the Ares rubble (by FlyStar) - Fixed the projection location of selectbox when over elevated bridge (by NetsuNegi) - Fixed an issue where the game would only use `Weapon1` and `Weapon2` for auto-targeting even when `MultiWeapon=yes` was set (by FlyStar) +- Fixed a game load crash caused by `MultiWeapon.IsSecondary=-1` or non-projectile weapons (by FlyStar) Fixes / interactions with other extensions: - Allowed `AuxBuilding` and Ares' `SW.Aux/NegBuildings` to count building upgrades (by Ollerus) diff --git a/src/Ext/TechnoType/Body.cpp b/src/Ext/TechnoType/Body.cpp index edde10ab88..7e03b7ca64 100644 --- a/src/Ext/TechnoType/Body.cpp +++ b/src/Ext/TechnoType/Body.cpp @@ -389,14 +389,18 @@ void TechnoTypeExt::ExtData::UpdateAdditionalAttributes() if (pWeapon) { - this->ThreatTypes.X |= pWeapon->AllowedThreats(); + if (pWeapon->Projectile) + this->ThreatTypes.X |= pWeapon->AllowedThreats(); + this->CombatDamages.X += (pWeapon->Damage + pWeapon->AmbientDamage); num++; } if (pEliteWeapon) { - this->ThreatTypes.Y |= pEliteWeapon->AllowedThreats(); + if (pEliteWeapon->Projectile) + this->ThreatTypes.Y |= pEliteWeapon->AllowedThreats(); + this->CombatDamages.Y += (pEliteWeapon->Damage + pEliteWeapon->AmbientDamage); eliteNum++; }