Skip to content

Commit 74d3082

Browse files
authored
Fix the bug that OpenToppedWarpDistance is calculated incorrectly for building target (#1739)
To verify the patch: 1. Set `OpenToppedWarpDistance` the same as CLEG's weapon range. Build a BFRT with no range bonus and a CLEG. 2. In vanilla, it will not warp big building targets (like a war factory) correctly on the edge distance. 3. With this fix, it can always warp the targets they fired at.
1 parent ed80778 commit 74d3082

File tree

4 files changed

+15
-0
lines changed

4 files changed

+15
-0
lines changed

CREDITS.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -552,6 +552,7 @@ This page lists all the individual contributions to the project by their author.
552552
- Targeting limitation for berzerk technos
553553
- Allows refineries to use multiple ActiveAnim simultaneously
554554
- Several attackmove related enhancement
555+
- Fix the bug that `OpenToppedWarpDistance` is calculated incorrectly for building target
555556
- **tyuah8**:
556557
- Drive/Jumpjet/Ship/Teleport locomotor did not power on when it is un-piggybacked bugfix
557558
- Destroyed unit leaves sensors bugfix

docs/Fixed-or-Improved-Logics.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -233,6 +233,7 @@ This page describes all ingame logics that are fixed or improved in Phobos witho
233233
- Fixed the bug that `DamageSelf` and `AllowDamageOnSelf` are ineffective on airforce.
234234
- Fixed the bug that damaged particle dont disappear after building has repaired by engineer.
235235
- Fixed the issue of incorrect position of `TrailerAnim` in `VoxelAnim`.
236+
- Fixed the bug that `OpenToppedWarpDistance` is calculated incorrectly for building target.
236237

237238
## Fixes / interactions with other extensions
238239

docs/Whats-New.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -437,6 +437,7 @@ Vanilla fixes:
437437
- Fixed the bug that `DamageSelf` and `AllowDamageOnSelf` are ineffective on airforce (by NetsuNegi)
438438
- Fixed the bug that damaged particle dont disappear after building has repaired by engineer (by NetsuNegi)
439439
- Fixed the issue of incorrect position of `TrailerAnim` in `VoxelAnim` (by CrimRecya)
440+
- Fixed the bug that `OpenToppedWarpDistance` is calculated incorrectly for building target (by TaranDahl)
440441
441442
Phobos fixes:
442443
- 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: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2250,3 +2250,15 @@ DEFINE_HOOK(0x489E47, DamageArea_RockerItemsFix2, 0x6)
22502250
}
22512251

22522252
#pragma region
2253+
2254+
DEFINE_HOOK(0x71A7BC, TemporalClass_Update_DistCheck, 0x6)
2255+
{
2256+
enum { SkipGameCode = 0x71A82C };
2257+
2258+
GET(TemporalClass*, pThis, ESI);
2259+
GET(TechnoClass*, pTarget, ECX);
2260+
2261+
// Vanilla check is incorrect for buildingtargets
2262+
R->EAX(pThis->Owner->DistanceFrom(pTarget));
2263+
return SkipGameCode;
2264+
}

0 commit comments

Comments
 (0)