diff --git a/docs/Fixed-or-Improved-Logics.md b/docs/Fixed-or-Improved-Logics.md index e766d55ad3..79638b4616 100644 --- a/docs/Fixed-or-Improved-Logics.md +++ b/docs/Fixed-or-Improved-Logics.md @@ -2335,7 +2335,7 @@ Sinkable.SquidGrab=true ; boolean ### Stationary vehicles -- Setting VehicleType `Speed` to 0 now makes game treat them as stationary, behaving in very similar manner to deployed vehicles with `IsSimpleDeployer` set to true. Should not be used on buildable vehicles, as they won't be able to exit factories. +- Setting `JumpjetAccel` to 0 for VehicleTypes with `Locomotor=Jumpjet` or setting `Speed` to 0 for other now makes game treat them as stationary, behaving in very similar manner to deployed vehicles with `IsSimpleDeployer` set to true. Should not be used on buildable vehicles, as they won't be able to exit factories. ### Turret recoil diff --git a/docs/Whats-New.md b/docs/Whats-New.md index 0169f87e34..cce5815b96 100644 --- a/docs/Whats-New.md +++ b/docs/Whats-New.md @@ -697,6 +697,7 @@ Phobos fixes: - Fixed a bug causing transfering AttachEffects (e.g on `DeploysInto`/`UndeploysInto`) not to immediately recalculate stats or tint (by Starkku) - Fixed a bug where updating the `OpenTopped` attribute during convert did not update the coordinates of passengers (by NetsuNegi) - Fixed `Shrapnel.AffectsBuildings=true` shrapnel weapons being able to hit the building itself, potentially multiple times, if it had foundation larger than 1x1 (by Starkku) +- Fixed a bug where stationary vehicles would also block movement caused by external factors (by Noble_Fish) Fixes / interactions with other extensions: diff --git a/src/Ext/Techno/Body.cpp b/src/Ext/Techno/Body.cpp index 2646b31b12..dd36d5bf0b 100644 --- a/src/Ext/Techno/Body.cpp +++ b/src/Ext/Techno/Body.cpp @@ -1,4 +1,4 @@ -#include "Body.h" +#include "Body.h" #include @@ -750,9 +750,17 @@ bool TechnoExt::IsHealthInThreshold(TechnoClass* pObject, double min, double max bool TechnoExt::CannotMove(UnitClass* pThis) { + if (pThis->LocomotorSource) + return false; + const auto pType = pThis->Type; - if (pType->Speed == 0) + if ((pType->Speed == 0 + && (pType->Locomotor != LocomotionClass::CLSIDs::Jumpjet + || pType->Teleporter)) + || (pType->Locomotor == LocomotionClass::CLSIDs::Jumpjet + && !pType->Teleporter + && pType->JumpjetAccel == 0.0)) return true; const auto movementRestrictedTo = pType->MovementRestrictedTo;