Skip to content

Commit f1ec073

Browse files
authored
[Minor] Fix a conflict between CanBeBuiltOn logic and UndeploysInto unhardcoding (#1819)
Fix the issue of building with `UndeploysInto` getting stuck when placing/deploying to a place that the top cell has an object with `IsPassable=false` and `CanBeBuiltOn=true` since the `WaterBound=true` buildings' `UndeploysInto` fix.
1 parent 7679315 commit f1ec073

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

src/Misc/Hooks.BugFixes.cpp

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1625,8 +1625,15 @@ DEFINE_HOOK(0x446D42, BuildingClass_Place_FreeUnit_NearByLocation2, 0x6)
16251625

16261626
DEFINE_HOOK(0x449462, BuildingClass_IsCellOccupied_UndeploysInto, 0x6)
16271627
{
1628-
enum { SkipGameCode = 0x449487 };
1628+
enum { PlacingCheck = 0x449493, SkipGameCode = 0x449487 };
16291629

1630+
GET(BuildingClass*, pThis, ECX);
1631+
1632+
// Placing check, only newly generated buildings in this mission
1633+
if (pThis->CurrentMission == Mission::None)
1634+
return PlacingCheck;
1635+
1636+
// Undeploying check
16301637
GET(BuildingTypeClass*, pType, EAX);
16311638
LEA_STACK(CellStruct*, pDest, 0x4);
16321639
const auto pCell = MapClass::Instance.GetCellAt(*pDest);

0 commit comments

Comments
 (0)