Skip to content

Commit b682637

Browse files
authored
Fixed an issue that technos head to building's dock even they are not going to dock (#1863)
To test this fix: 1. set `[GAYARD] -> DockingOffset0=9999,0,0` 2. order an `[CARRIER]` to attack `[GAYARD]` In vanilla, the hornets will head to the dock crd and be unable to fire. With this fix, they should head to the shipyard itself and fire normally.
1 parent c1f9894 commit b682637

File tree

4 files changed

+13
-1
lines changed

4 files changed

+13
-1
lines changed

CREDITS.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -618,6 +618,7 @@ This page lists all the individual contributions to the project by their author.
618618
- Fix an issue that jumpjet vehicles can not stop correctly when assigned a target in range
619619
- Fix an issue that jumpjet infantries stop incorrectly when assigned a target out of range
620620
- Fix an issue that jumpjet infantries' shadow is always drawn even if they are cloaked
621+
- Fix an issue that technos head to building's dock even they are not going to dock
621622
- **solar-III (凤九歌)**
622623
- Target scanning delay customization (documentation)
623624
- Skip target scanning function calling for unarmed technos (documentation)

docs/Fixed-or-Improved-Logics.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -293,6 +293,7 @@ This page describes all ingame logics that are fixed or improved in Phobos witho
293293
- Fixed an issue that jumpjet vehicles can not stop correctly when assigned a target in range.
294294
- Fixed an issue that jumpjet infantries stop incorrectly when assigned a target out of range.
295295
- Fixed an issue that jumpjet infantries' shadow is always drawn even if they are cloaked.
296+
- Fixed an issue that technos head to building's dock even they are not going to dock.
296297

297298
```{note}
298299
The described behavior is a replica of and is compliant with XNA CnCNet Client's multiplayer save game support.

docs/Whats-New.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -474,6 +474,7 @@ Vanilla fixes:
474474
- Jumpjets in air now can correctly spawn missiles (by TaranDahl)
475475
- Fixed an issue that the currently hovered planning node not update up-to-date, such as using hotkeys to select technos (by CrimRecya)
476476
- Fixed an issue that jumpjet infantries' shadow is always drawn even if they are cloaked (by TaranDahl)
477+
- Fixed an issue that technos head to building's dock even they are not going to dock (by TaranDahl)
477478
478479
Phobos fixes:
479480
- Fixed the bug that `AllowAirstrike=no` cannot completely prevent air strikes from being launched against it (by NetsuNegi)

src/Ext/Techno/Hooks.Misc.cpp

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -278,6 +278,15 @@ DEFINE_HOOK(0x4D962B, FootClass_SetDestination_RecycleFLH, 0x5)
278278
*pDestCrd += TechnoExt::GetFLHAbsoluteCoords(pCarrier, FLH, pCarrierTypeExt->Spawner_RecycleOnTurret) - pCarrier->GetCoords();
279279
}
280280
}
281+
else if (pThis->Destination->WhatAmI() == AbstractType::Building
282+
&& pThis->QueuedMission != Mission::Enter && pThis->GetCurrentMission() != Mission::Enter)
283+
{
284+
GET(CoordStruct*, pDestCrd, EAX);
285+
auto crd = pThis->Destination->GetCoords();
286+
crd.X = ((crd.X >> 8) << 8) + 128;
287+
crd.Y = ((crd.Y >> 8) << 8) + 128;
288+
*pDestCrd = crd;
289+
}
281290

282291
return 0;
283292
}
@@ -845,4 +854,4 @@ DEFINE_HOOK(0x73D6E6, UnitClass_Unload_Subterranean, 0x6)
845854
}
846855

847856
return 0;
848-
}
857+
}

0 commit comments

Comments
 (0)