Skip to content

Commit

Permalink
Fixed disguised units not using the correct palette if target has cus…
Browse files Browse the repository at this point in the history
…tom palette (Phobos-developers#1352)

It just a bugfix.

---------

Co-authored-by: Kerbiter <[email protected]>
  • Loading branch information
NetsuNegi and Metadorius authored Aug 15, 2024
1 parent 4daf90f commit 34491c5
Show file tree
Hide file tree
Showing 4 changed files with 22 additions and 0 deletions.
1 change: 1 addition & 0 deletions CREDITS.md
Original file line number Diff line number Diff line change
Expand Up @@ -319,6 +319,7 @@ This page lists all the individual contributions to the project by their author.
- **NetsuNegi**
- Forbidding parallel AI queues by type
- Jumpjet crash speed fix when crashing onto building
- Disguised units not using the correct palette if target has custom palette bugfix
- **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 @@ -162,6 +162,7 @@ This page describes all ingame logics that are fixed or improved in Phobos witho
- OverlayTypes now read and use `ZAdjust` if specified in their `artmd.ini` entry.
- Setting `[AudioVisual]` -> `ColorAddUse8BitRGB` to true makes game treat values from `[ColorAdd]` as 8-bit RGB (0-255) instead of RGB565 (0-31 for red & blue, 0-63 for green). This works for `LaserTargetColor`, `IronCurtainColor`, `BerserkColor` and `ForceShieldColor`.
- Weapons with `AA=true` Projectile can now correctly fire at air units when both firer and target are over a bridge.
- Fixed disguised units not using the correct palette if target has custom palette.

## 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 @@ -723,6 +723,7 @@ Vanilla fixes:
- Fixed railgun particles being drawn to wrong coordinate against buildings with non-default `TargetCoordOffset` or when force-firing on bridges (by Starkku)
- Fixed building `TargetCoordOffset` not being taken into accord for several things like fire angle calculations and target lines (by Starkku)
- Allowed observers to see a selected building's radial indicator (by Trsdy)
- Fixed disguised units not using the correct palette if target has custom palette (by NetsuNegi)
Phobos fixes:
- Fixed shields being able to take damage when the parent TechnoType was under effects of a `Temporal` Warhead (by Starkku)
Expand Down
19 changes: 19 additions & 0 deletions src/Misc/Hooks.BugFixes.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -896,3 +896,22 @@ DEFINE_HOOK(0x753D86, VoxelCalcNormals_NullAdditionalVector, 0x0)

return 0x753D9E;
}

DEFINE_HOOK(0x705D74, TechnoClass_GetRemapColour_DisguisePalette, 0x8)
{
enum { SkipGameCode = 0x705D7C };

GET(TechnoClass* const, pThis, ESI);

auto pTechnoType = pThis->GetTechnoType();

if (!pThis->IsClearlyVisibleTo(HouseClass::CurrentPlayer))
{
if (const auto pDisguise = TechnoTypeExt::GetTechnoType(pThis->Disguise))
pTechnoType = pDisguise;
}

R->EAX(pTechnoType);

return SkipGameCode;
}

0 comments on commit 34491c5

Please sign in to comment.