Skip to content

Commit 751a94e

Browse files
authored
[Vanilla Fix]Fix the bug that uncontrolled scatter when elite techno attack by aircraft or some unit try crush it (#1694)
When attacked by aircraft. When a unit want crush it. When attacked by infantry and the infantry's primary weapon has `Speed` lower than `[CombatDamage]>Incoming`.
1 parent 1dba2a4 commit 751a94e

File tree

4 files changed

+27
-0
lines changed

4 files changed

+27
-0
lines changed

CREDITS.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -398,6 +398,7 @@ This page lists all the individual contributions to the project by their author.
398398
- Tiberium eater logic
399399
- Fix the bug that ships can travel on elevated bridges
400400
- Original `Arcing` elevation inaccuracy fix
401+
- Fix the bug that uncontrolled scatter when elite techno attacked by aircraft or some unit try crush it
401402
- **Apollo** - Translucent SHP drawing patches
402403
- **ststl**:
403404
- 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
@@ -227,6 +227,7 @@ This page describes all ingame logics that are fixed or improved in Phobos witho
227227
- Fixed the bug that ships can travel on elevated bridges.
228228
- Dehardcoded 255 limit of `OverlayType`.
229229
- Fixed an issue where airstrike flare line drawn to target at lower elevation would clip.
230+
- Fixed the bug that uncontrolled scatter when elite techno attacked by aircraft or some unit try crush it.
230231

231232
## Fixes / interactions with other extensions
232233

docs/Whats-New.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -402,6 +402,7 @@ Vanilla fixes:
402402
- Fixed the bug that infantry ignored `Passengers` and `SizeLimit` when entering buildings (by NetsuNegi)
403403
- Fixed the bug that ships can travel on elevated bridges (by NetsuNegi)
404404
- Fixed an issue where airstrike flare line drawn to target at lower elevation would clip (by Starkku)
405+
- Fixed the bug that uncontrolled scatter when elite techno attacked by aircraft or some unit try crush it (by NetsuNegi)
405406
406407
Phobos fixes:
407408
- 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: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1979,3 +1979,27 @@ DEFINE_HOOK(0x47EAF7, CellClass_RemoveContent_BeforeUnmarkOccupationBits, 0x7)
19791979
R->EAX(pContent->WhatAmI());
19801980
return ContinueCheck;
19811981
}
1982+
1983+
DEFINE_HOOK(0x481778, CellClass_ScatterContent_Scatter, 0x6)
1984+
{
1985+
enum { NextTechno = 0x4817D9 };
1986+
1987+
GET(TechnoClass*, pTechno, ESI);
1988+
1989+
if (!pTechno)
1990+
return NextTechno;
1991+
1992+
REF_STACK(const CoordStruct, coords, STACK_OFFSET(0x2C, 0x4));
1993+
GET_STACK(const bool, ignoreMission, STACK_OFFSET(0x2C, 0x8));
1994+
GET_STACK(const bool, ignoreDestination, STACK_OFFSET(0x2C, 0xC));
1995+
1996+
if (ignoreDestination || pTechno->HasAbility(Ability::Scatter)
1997+
|| (pTechno->Owner->IsControlledByHuman()
1998+
? RulesClass::Instance->PlayerScatter
1999+
: pTechno->Owner->IQLevel2 >= RulesClass::Instance->Scatter))
2000+
{
2001+
pTechno->Scatter(coords, ignoreMission, ignoreDestination);
2002+
}
2003+
2004+
return NextTechno;
2005+
}

0 commit comments

Comments
 (0)