Skip to content
Merged
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
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ Credits
- SMxReaver - help with docs
- 4SG - help with docs
- wiktorderelf - overhauled Unicode font
- Thrifinesma (Uranusian) - Mind Control enhancement, custom warhead splash list, harvesters counter, promoted spawns, shields, overhauled Unicode font, help with docs
- Thrifinesma (Uranusian) - Mind Control enhancement, custom warhead splash list, harvesters counter, promoted spawns, shields, death after dead fix, overhauled Unicode font, help with docs
- SEC-SOME (secsome) - debug info dump hotkey, refactoring & porting of Ares helper code, introducing more Ares-derived stuff, disguise removal warhead, Mind Control removal warhead, Mind Control enhancement, shields
- Otamaa (BoredEXE) - help with CellSpread, ported and fixed custom RadType code, togglable ElectricBolt bolts, customizable Chrono Locomotor properties per TechnoClass
- E1 Elite - TileSet 255 and above bridge repair fix
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 @@ -5,6 +5,7 @@ This page describes all ingame logics that are fixed or improved in Phobos witho
## Bugfixes and miscellanous

- Fixed the bug when deploying mindcontrolled vehicle into a building permanently trasferred the control to the house which mindcontrolled it.
- Fixed the bug when units are already dead but still in map (for sinking, crashing, dying animation, etc.), they could die again.
- SHP debris shadows now respect the `Shadow` tag.
- Allowed usage of TileSet of 255 and above without making NE-SW broken bridges unrepairable.
- `TurretOffset` tag for voxel turreted technos now accepts FLH (forward, lateral, height) values like `TurretOffset=F,L` or `TurretOffset=F,L,H`, which means turret location can be adjusted in all three axes.
Expand Down
1 change: 1 addition & 0 deletions docs/Whats-New.md
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@ Vanilla fixes:
- Tileset 255+ bridge fix (by E1 Elite)
- Fixed fatal errors when `Blowfish.dll` couldn't be registered in the system properly due to missing admin rights (by Belonit)
- Fix to take Burst into account for aircraft weapon shots beyond the first one (by Starkku)
- Fixed the bug when units are already dead but still in map (for sinking, crashing, dying animation, etc.), they could die again (by Uranusian)

Phobos fixes:
- Properly rewritten a fix for mind-controlled vehicles deploying into buildings (by FS-21)
Expand Down
37 changes: 36 additions & 1 deletion src/Misc/Hooks.BugFixes.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
#include <AnimClass.h>
#include <TechnoClass.h>
#include <FootClass.h>

#include <UnitClass.h>
//Replace: checking of HasExtras = > checking of (HasExtras && Shadow)
DEFINE_HOOK(423365, Phobos_BugFixes_SHPShadowCheck, 8)
{
Expand All @@ -26,3 +26,38 @@ DEFINE_HOOK(423365, Phobos_BugFixes_SHPShadowCheck, 8)
DEFINE_LJMP(0x545CE2, 0x545CE9) //Phobos_BugFixes_Tileset255_RemoveNonMMArrayFill
DEFINE_LJMP(0x546C23, 0x546C8B) //Phobos_BugFixes_Tileset255_RefNonMMArray


// WWP's shit code! Wrong check.
// To avoid units dying when they are already dead.
DEFINE_HOOK(5F53AA, ObjectClass_ReceiveDamage_DyingFix, 6)
{
GET(int, health, EAX);
GET(ObjectClass*, pThis, ESI);

if (health <= 0 || !pThis->IsAlive)
return 0x5F583E; // return DamageState::PostMortem

return 0x5F53B0; //continue vanilla check
}

DEFINE_HOOK(4D7431, FootClass_ReceiveDamage_DyingFix, 5)
{
GET(FootClass*, pThis, ESI);
GET(DamageState, result, EAX);

if (result != DamageState::PostMortem && (pThis->IsSinking || pThis->IsCrashing))
R->EAX(DamageState::PostMortem);

return 0;
}

DEFINE_HOOK(737D57, UnitClass_ReceiveDamage_DyingFix, 7)
{
GET(UnitClass*, pThis, ESI);
GET(DamageState, result, EAX);

if (result != DamageState::PostMortem && pThis->DeathFrameCounter > 0)
R->EAX(DamageState::PostMortem);

return 0;
}