Skip to content

Commit 0036b27

Browse files
authored
[Vanilla Fix] Fix the bug that ships can travel on elevated bridges (#1659)
1 parent f0c0f4b commit 0036b27

File tree

4 files changed

+14
-0
lines changed

4 files changed

+14
-0
lines changed

CREDITS.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -390,6 +390,7 @@ This page lists all the individual contributions to the project by their author.
390390
- Fix the bug that `AllowAirstrike=no` cannot completely prevent air strikes from being launched against it
391391
- Fix the bug that infantry ignored `Passengers` and `SizeLimit` when entering buildings
392392
- Tiberium eater logic
393+
- Fix the bug that ships can travel on elevated bridges
393394
- **Apollo** - Translucent SHP drawing patches
394395
- **ststl**:
395396
- Customizable `ShowTimer` priority of superweapons

docs/Fixed-or-Improved-Logics.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -224,6 +224,7 @@ This page describes all ingame logics that are fixed or improved in Phobos witho
224224
- Fixed the issue where computer players did not search for new enemies after defeating them or forming alliances with them.
225225
- Fixed the bug that infantry ignored `Passengers` and `SizeLimit` when entering buildings.
226226
- Fixed `VoiceDeploy` not played, when deployed through hot-key/command bar.
227+
- Fixed the bug that ships can travel on elevated bridges.
227228

228229
## Fixes / interactions with other extensions
229230

docs/Whats-New.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -395,6 +395,7 @@ Vanilla fixes:
395395
- Fixed the bug that buildings will always be tinted as airstrike owner (by NetsuNegi)
396396
- Fixed the issue where computer players did not search for new enemies after defeating them or forming alliances with them (by FlyStar)
397397
- Fixed the bug that infantry ignored `Passengers` and `SizeLimit` when entering buildings (by NetsuNegi)
398+
- Fixed the bug that ships can travel on elevated bridges (by NetsuNegi)
398399
399400
Phobos fixes:
400401
- Fixed the bug that `AllowAirstrike=no` cannot completely prevent air strikes from being launched against it (by NetsuNegi)

src/Misc/Hooks.BugFixes.cpp

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1560,6 +1560,17 @@ DEFINE_HOOK(0x449462, BuildingClass_IsCellOccupied_UndeploysInto, 0x6)
15601560
return SkipGameCode;
15611561
}
15621562

1563+
DEFINE_HOOK(0x73FA92, UnitClass_IsCellOccupied_LandType, 0x8)
1564+
{
1565+
enum { ContinueCheck = 0x73FC24, NoMove = 0x73FACD };
1566+
1567+
GET(UnitClass*, pThis, EBX);
1568+
GET(CellClass*, pCell, EDI);
1569+
GET_STACK(bool, containsBridge, STACK_OFFSET(0x90, -0x7D));
1570+
1571+
return GroundType::Array[static_cast<int>(containsBridge ? LandType::Road : pCell->LandType)].Cost[static_cast<int>(pThis->Type->SpeedType)] == 0.0f ? NoMove : ContinueCheck;
1572+
}
1573+
15631574
#pragma region XSurfaceFix
15641575

15651576
// Fix a crash at 0x7BAEA1 when trying to access a point outside of surface bounds.

0 commit comments

Comments
 (0)