Skip to content

Commit

Permalink
Fix MakeInfantry unit palette anims not using cell lighting even if U…
Browse files Browse the repository at this point in the history
…seNormalLight=false
  • Loading branch information
Starkku committed Sep 21, 2024
1 parent 4bf1486 commit d1ecdca
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 0 deletions.
1 change: 1 addition & 0 deletions docs/Fixed-or-Improved-Logics.md
Original file line number Diff line number Diff line change
Expand Up @@ -168,6 +168,7 @@ This page describes all ingame logics that are fixed or improved in Phobos witho
- Planning paths are now shown for all units under player control or when `[GlobalControls]->DebugPlanningPaths=yes` in singleplayer game modes.
- Fixed `Temporal=true` Warheads potentially crashing game if used to attack `Slaved=true` infantry.
- Fixed some locomotors (Tunnel, Walk, Mech) getting stuck when moving too fast.
- Animations with `MakeInfantry` and `UseNormalLight=false` that are drawn in unit palette will now have cell lighting changes applied on them (by Starkku)

## 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 @@ -524,6 +524,7 @@ Vanilla fixes:
- Subterranean units are no longer allowed to perform deploy functions like firing weapons or `IsSimpleDeployer` while burrowed or burrowing, they will instead emerge first like they do for transport unloading (by Starkku)
- Fixed `Temporal=true` Warheads potentially crashing game if used to attack `Slaved=true` infantry (by Starkku)
- Fixed some locomotors (Tunnel, Walk, Mech) getting stuck when moving too fast (by NetsuNegi)
- Animations with `MakeInfantry` and `UseNormalLight=false` that are drawn in unit palette will now have cell lighting changes applied on them (by Starkku)
Phobos fixes:
- Fixed a few errors of calling for superweapon launch by `LaunchSW` or building infiltration (by Trsdy)
Expand Down
17 changes: 17 additions & 0 deletions src/Ext/Anim/Hooks.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -312,6 +312,23 @@ DEFINE_HOOK(0x423365, AnimClass_DrawIt_ExtraShadow, 0x8)
return SkipExtraShadow;
}

// Apply cell lighting on UseNormalLight=no MakeInfantry anims.
DEFINE_HOOK(0x4232BF, AnimClass_DrawIt_MakeInfantry, 0x6)
{
enum { SkipGameCode = 0x4232C5 };

GET(AnimClass*, pThis, ESI);

if (pThis->Type->MakeInfantry != -1)
{
auto const pCell = pThis->GetCell();
R->EAX(pCell->Intensity_Normal);
return SkipGameCode;
}

return 0;
}

#pragma region AltPalette

// Fix AltPalette anims not using owner color scheme.
Expand Down

0 comments on commit d1ecdca

Please sign in to comment.