Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
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 @@ -517,6 +517,7 @@ This page lists all the individual contributions to the project by their author.
- Fix the bug that if paradropping technos with `Crashable=yes` has been destroyed in air, they will falling down on ground but not dead
- Fix the bug where paradropped infantry with `NotHuman=yes` will ignore `Crashable=no` and crash on ground when killed in air
- Fix an issue where a unit might cause the target to fall from above its own head when using a locomotor warhead with `Locomotor=Jumpjet` to pull a target with `BalloonHover=yes`
- Fix the initial direction of building placed by Ares's UnitDelivery superweapon
- **Apollo** - Translucent SHP drawing patches
- **ststl**:
- Customizable `ShowTimer` priority of superweapons
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 @@ -357,6 +357,7 @@ This page describes all ingame logics that are fixed or improved in Phobos witho
- Fixed the bug that building with `Explodes=yes` use Ares's rubble logic will cause it's owner cannot defeat normally.
- Modified the ares hook that stopped OpenTopped transports from firing if cloaked.
- Fixed an Ares bug that led to erroneous interactions where the parasite would frequently reset to the victim's position under specific circumstances and that was highly prone to crashes.
- Fixed the initial direction of building placed by Ares's UnitDelivery superweapon.

## Newly added global settings

Expand Down
1 change: 1 addition & 0 deletions docs/Whats-New.md
Original file line number Diff line number Diff line change
Expand Up @@ -672,6 +672,7 @@ Fixes / interactions with other extensions:
- Fixed the bug that building with `Explodes=yes` use Ares's rubble logic will cause it's owner cannot defeat normally (by NetsuNegi)
- Modified the ares hook that stopped OpenTopped transports from firing if cloaked (by RAZER & Morton)
- Fixed an Ares bug that led to erroneous interactions where the parasite would frequently reset to the victim's position under specific circumstances and that was highly prone to crashes (by NetsuNegi)
- Fixed the initial direction of building placed by Ares's UnitDelivery superweapon (by NetsuNegi)

```

Expand Down
5 changes: 5 additions & 0 deletions docs/locale/zh_CN/LC_MESSAGES/CREDITS.po
Original file line number Diff line number Diff line change
Expand Up @@ -1694,6 +1694,11 @@ msgid ""
msgstr ""
"修复了单位使用 `Locomotor=Jumpjet` 的运动模式弹头牵引拥有 `BalloonHover=yes` 的目标时可能使其从自己头顶下落的问题"

msgid ""
"Fix the initial direction of building placed by Ares's UnitDelivery superweapon"
msgstr ""
"修复了 Ares 的单位投放超级武器投放的建筑物的初始朝向"

msgid "**Apollo** - Translucent SHP drawing patches"
msgstr "**Apollo** - 半透明 SHP 绘制补丁"

Expand Down
4 changes: 4 additions & 0 deletions docs/locale/zh_CN/LC_MESSAGES/Fixed-or-Improved-Logics.po
Original file line number Diff line number Diff line change
Expand Up @@ -1795,6 +1795,10 @@ msgid ""
"circumstances and that was highly prone to crashes."
msgstr "修复了一个极易崩溃且导致寄生者特定条件下会被高频重设至受害者位置这一错误交互的 Ares Bug。"

msgid ""
"Fixed the initial direction of building placed by Ares's UnitDelivery superweapon."
msgstr "修复了 Ares 的单位投放超级武器投放的建筑物的初始朝向。"

msgid "Newly added global settings"
msgstr "新增的全局设定"

Expand Down
4 changes: 4 additions & 0 deletions docs/locale/zh_CN/LC_MESSAGES/Whats-New.po
Original file line number Diff line number Diff line change
Expand Up @@ -2360,6 +2360,10 @@ msgid ""
"circumstances and that was highly prone to crashes (by NetsuNegi)"
msgstr "修复了一个极易崩溃且导致寄生者特定条件下会被高频重设至受害者位置这一错误交互的 Ares Bug(by NetsuNegi)"

msgid ""
"Fixed the initial direction of building placed by Ares's UnitDelivery superweapon (by NetsuNegi)"
msgstr "修复了 Ares 的单位投放超级武器投放的建筑物的初始朝向(by NetsuNegi)"

msgid "0.4.0.3"
msgstr "0.4.0.3"

Expand Down
9 changes: 2 additions & 7 deletions src/Misc/Hooks.AlphaImage.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -72,13 +72,8 @@ static void __fastcall UpdateAlphaShape(ObjectClass* pSource)

const auto pBuilding = abstract_cast<BuildingClass*, true>(pSource);

if (pBuilding)
{
const auto currMission = pBuilding->GetCurrentMission();

if (currMission != Mission::Construction && currMission != Mission::Selling)
inactive |= !pBuilding->IsPowerOnline() || BuildingExt::ExtMap.Find(pBuilding)->LimboID != -1;
}
if (pBuilding && !inactive && pBuilding->GetCurrentMission() != Mission::Construction)
inactive |= !pBuilding->IsPowerOnline() || BuildingExt::ExtMap.Find(pBuilding)->LimboID != -1;

auto& alphaExt = *AresFunctions::AlphaExtMap;

Expand Down
27 changes: 27 additions & 0 deletions src/Misc/Hooks.Ares.cpp
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
#include <Utilities/AresHelper.h>
#include <Utilities/AresFunctions.h>
#include <Utilities/Helpers.Alex.h>

#include <Ext/Building/Body.h>
Expand Down Expand Up @@ -86,6 +87,26 @@ static bool __fastcall PermaMC_SetOwningHouse_Select(TechnoClass* pTechno, void*
return result;
}

namespace UnitDeliveryTemp
{
bool Placing = false;
}

static void __fastcall UnitDeliveryStateMachine_Update_Wrapper(void* pThis)
{
UnitDeliveryTemp::Placing = true;
AresFunctions::UnitDeliveryStateMachine_Update(pThis);
UnitDeliveryTemp::Placing = false;
}

DEFINE_HOOK(0x440580, BuildingClass_Unlimbo_UnitDeliveryFix, 0x5)
{
if (UnitDeliveryTemp::Placing)
R->Stack(0x8, DirType::North);

return 0;
}

_GET_FUNCTION_ADDRESS(RadarJammerClass::Update, AresRadarJammerClass_Update_GetAddr)

void Apply_Ares3_0_Patches()
Expand Down Expand Up @@ -159,6 +180,9 @@ void Apply_Ares3_0_Patches()
// Handle select of MindControl.Permanent
Patch::Apply_CALL(AresHelper::AresBaseAddress + 0x45EAF, &PermaMC_FreeUnit_SetContext);
Patch::Apply_CALL6(AresHelper::AresBaseAddress + 0x45EBE, &PermaMC_SetOwningHouse_Select);

// Fix building direction of Ares's UnitDelivery
Patch::Apply_VTABLE(AresHelper::AresBaseAddress + 0xA8D94, &UnitDeliveryStateMachine_Update_Wrapper);
}

void Apply_Ares3_0p1_Patches()
Expand Down Expand Up @@ -234,4 +258,7 @@ void Apply_Ares3_0p1_Patches()
// Handle select of MindControl.Permanent
Patch::Apply_CALL(AresHelper::AresBaseAddress + 0x46A1F, &PermaMC_FreeUnit_SetContext);
Patch::Apply_CALL6(AresHelper::AresBaseAddress + 0x46A2E, &PermaMC_SetOwningHouse_Select);

// Fix building direction of Ares's UnitDelivery
Patch::Apply_VTABLE(AresHelper::AresBaseAddress + 0xA9F28, &UnitDeliveryStateMachine_Update_Wrapper);
}
5 changes: 5 additions & 0 deletions src/Utilities/AresAddressInit.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ decltype(AresFunctions::CreateAresEBolt) AresFunctions::CreateAresEBolt = nullpt
decltype(AresFunctions::SpawnSurvivors) AresFunctions::SpawnSurvivors = nullptr;
decltype(AresFunctions::ReverseEngineer) AresFunctions::ReverseEngineer = nullptr;
decltype(AresFunctions::IsTargetConstraintsEligible) AresFunctions::IsTargetConstraintsEligible = nullptr;
decltype(AresFunctions::UnitDeliveryStateMachine_Update) AresFunctions::UnitDeliveryStateMachine_Update = nullptr;
std::function<AresSWTypeExtData* (SuperWeaponTypeClass*)> AresFunctions::SWTypeExtMap_Find;
PhobosMap<ObjectClass*, AlphaShapeClass*>* AresFunctions::AlphaExtMap = nullptr;

Expand Down Expand Up @@ -42,6 +43,8 @@ void AresFunctions::InitAres3_0()

NOTE_ARES_FUN(IsTargetConstraintsEligible, 0x032110);

NOTE_ARES_FUN(UnitDeliveryStateMachine_Update, 0x075DE0);

NOTE_ARES_FUN(_SWTypeExtMapFind, 0x57C70);
NOTE_ARES_FUN(_SWTypeExtMap, 0xC1C54);
SWTypeExtMap_Find = [](SuperWeaponTypeClass* swt) { return _SWTypeExtMapFind(_SWTypeExtMap, swt); };
Expand Down Expand Up @@ -78,6 +81,8 @@ void AresFunctions::InitAres3_0p1()

NOTE_ARES_FUN(IsTargetConstraintsEligible, 0x032AF0);

NOTE_ARES_FUN(UnitDeliveryStateMachine_Update, 0x076E90);

NOTE_ARES_FUN(_SWTypeExtMapFind, 0x58900);
NOTE_ARES_FUN(_SWTypeExtMap, 0xC2C50);
SWTypeExtMap_Find = [](SuperWeaponTypeClass* swt) { return _SWTypeExtMapFind(_SWTypeExtMap, swt); };
Expand Down
2 changes: 2 additions & 0 deletions src/Utilities/AresFunctions.h
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,8 @@ class AresFunctions

static bool(__thiscall* IsTargetConstraintsEligible)(void*, HouseClass*, bool);

static void(__thiscall* UnitDeliveryStateMachine_Update)(void*);

static std::function<AresSWTypeExtData* (SuperWeaponTypeClass*)> SWTypeExtMap_Find;

static PhobosMap<ObjectClass*, AlphaShapeClass*>* AlphaExtMap;
Expand Down
Loading