Skip to content

Commit 15079f0

Browse files
CrimRecyaCoronia
authored andcommitted
Merge remote-tracking branch 'upstream/develop' into develop-FcWpInRangeFix
2 parents 4415f1e + 751a94e commit 15079f0

File tree

6 files changed

+30
-2
lines changed

6 files changed

+30
-2
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/New-or-Enhanced-Logics.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1404,7 +1404,7 @@ FLHKEY.BurstN= ; integer - Forward,Lateral,Height. FLHKey refers to weapon-spec
14041404
- `ForceWeapon.Cloaked` forces specified weapon to be used against any cloaked targets.
14051405
- `ForceWeapon.Disguised` forces specified weapon to be used against any disguised targets.
14061406
- `ForceWeapon.UnderEMP` forces specified weapon to be used if the target is under EMP effect.
1407-
- `ForceWeapon.InRange` forces specified a list of weapons to be used once the target is within their `Range`. When `ForceWeapon.InRange.TechnoOnly=true`, it will only be effective for technotypes like other `ForceWeapon`. The first weapon in the listed order satisfied will be selected. Can be applied to both ground and air target if `ForceAAWeapon.InRange` is not set.
1407+
- `ForceWeapon.InRange` forces specified a list of weapons to be used once the target is within their `Range`. If `ForceWeapon.InRange.TechnoOnly` set to true, it'll only be forced on TechnoTypes like other forced weapons, otherwise it'll also be forced when attacking empty grounds. The first weapon in the listed order satisfied will be selected. Can be applied to both ground and air target if `ForceAAWeapon.InRange` is not set.
14081408
- `ForceAAWeapon.InRange` does the same thing but only for air target. Taking priority to `ForceWeapon.InRange`, which means that it can only be applied to ground target when they're both set.
14091409
- `Force(AA)Weapon.InRange.Overrides` overrides the range when decides which weapon to use. Value from position matching the position from `Force(AA)Weapon.InRange` is used if found, or the weapon's own `Range` if not found or set to a value below 0.
14101410
- If `Force(AA)Weapon.InRange.ApplyRangeModifiers` is set to true, any applicable weapon range modifiers from the firer are applied to the decision range.

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/Ext/Unit/Hooks.Harvester.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,8 +39,9 @@ DEFINE_HOOK(0x73E730, UnitClass_MissionHarvest_HarvesterScanAfterUnload, 0x5)
3939
GET(UnitClass* const, pThis, EBP);
4040
GET(AbstractClass* const, pFocus, EAX);
4141

42+
auto pType = pThis->Type;
4243
// Focus is set when the harvester is fully loaded and go home.
43-
if (pFocus && TechnoTypeExt::ExtMap.Find(pThis->Type)->HarvesterScanAfterUnload.Get(RulesExt::Global()->HarvesterScanAfterUnload))
44+
if (pFocus && !pType->Weeder && TechnoTypeExt::ExtMap.Find(pType)->HarvesterScanAfterUnload.Get(RulesExt::Global()->HarvesterScanAfterUnload))
4445
{
4546
auto cellBuffer = CellStruct::Empty;
4647
const auto pCellStru = pThis->ScanForTiberium(&cellBuffer, RulesClass::Instance->TiberiumLongScan / Unsorted::LeptonsPerCell, 0);

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)