Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[BugFix]Drive/Jumpjet/Ship/Teleport locomotor did not power on when it is un-piggybacked bugfix #1394

Open
wants to merge 6 commits into
base: develop
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CREDITS.md
Original file line number Diff line number Diff line change
Expand Up @@ -368,6 +368,7 @@ This page lists all the individual contributions to the project by their author.
- Skirmish AI "sell all buildings and set all technos to hunt" behavior dehardcode
- Skirmish AI "gather when MCV deploy" behavior dehardcode
- Global value of `RepairBaseNodes`
- **tyuah8** - Drive/Jumpjet/Ship/Teleport locomotor did not power on when it is un-piggybacked bugfix
- **Ares developers**
- YRpp and Syringe which are used, save/load, project foundation and generally useful code from Ares
- unfinished RadTypes code
Expand Down
1 change: 1 addition & 0 deletions docs/Fixed-or-Improved-Logics.md
Original file line number Diff line number Diff line change
Expand Up @@ -171,6 +171,7 @@ This page describes all ingame logics that are fixed or improved in Phobos witho
- Animations with `MakeInfantry` and `UseNormalLight=false` that are drawn in unit palette will now have cell lighting changes applied on them.
- Removed 0 damage effect on jumpjet infantries from `InfDeath=9` warhead.
- Fixed Nuke & Dominator Level lighting not applying to AircraftTypes.
- Drive/Jumpjet/Ship/Teleport locomotor did not power on when it is un-piggybacked bugfix

## Fixes / interactions with other extensions

Expand Down
1 change: 1 addition & 0 deletions docs/Whats-New.md
Original file line number Diff line number Diff line change
Expand Up @@ -530,6 +530,7 @@ Vanilla fixes:
- Animations with `MakeInfantry` and `UseNormalLight=false` that are drawn in unit palette will now have cell lighting changes applied on them (by Starkku)
- Fixed Nuke & Dominator Level lighting not applying to AircraftTypes (by Starkku)
- Removed the 0 damage effect from `InfDeath=9` warheads to in-air infantries (by Trsdy)
- Drive/Jumpjet/Ship/Teleport locomotor did not power on when it is un-piggybacked bugfix (by tyuah8)

Phobos fixes:
- Fixed a few errors of calling for superweapon launch by `LaunchSW` or building infiltration (by Trsdy)
Expand Down
1 change: 1 addition & 0 deletions src/Misc/Hooks.Ares.cpp
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
#include <BuildingClass.h>
#include <FootClass.h>

#include <Utilities/Macro.h>

// In vanilla YR, game destroys building animations directly by calling constructor.
Expand Down
42 changes: 42 additions & 0 deletions src/Misc/Hooks.BugFixes.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -968,3 +968,45 @@ DEFINE_HOOK(0x5B11DD, MechLocomotionClass_ProcessMoving_SlowdownDistance, 0x9)
}

DEFINE_JUMP(LJMP, 0x517FF5, 0x518016); // Warhead with InfDeath=9 versus infantry in air

#pragma region End_Piggyback PowerOn
// Auther: tyuah8
static void End_Piggyback_PowerOn(ILocomotion* loco)
{
const auto pLoco = static_cast<LocomotionClass*>(loco);
const auto pLinkedTo = pLoco->LinkedTo;

if (!pLinkedTo->Deactivated && !pLinkedTo->IsUnderEMP())
pLoco->Power_On();
else
pLoco->Power_Off();
}

DEFINE_HOOK(0x4AF94D, DriveLocomotionClass__End_Piggyback__PowerOn, 0x7)
{
GET(ILocomotion*, loco, EAX);
End_Piggyback_PowerOn(loco);
return 0;
}

DEFINE_HOOK(0x54DADC, JumpjetLocomotionClass__End_Piggyback__PowerOn, 0x5)
{
GET(ILocomotion*, loco, EAX);
End_Piggyback_PowerOn(loco);
return 0;
}

DEFINE_HOOK(0x69F05D, ShipLocomotionClass__End_Piggyback__PowerOn, 0x7)
{
GET(ILocomotion*, loco, EAX);
End_Piggyback_PowerOn(loco);
return 0;
}

DEFINE_HOOK(0x719F17, TeleportLocomotionClass__End_Piggyback__PowerOn, 0x5)
{
GET(ILocomotion*, loco, ECX);
End_Piggyback_PowerOn(loco);
return 0;
}
#pragma endregion
Loading