Skip to content

Commit d1ecdca

Browse files
committed
Fix MakeInfantry unit palette anims not using cell lighting even if UseNormalLight=false
1 parent 4bf1486 commit d1ecdca

File tree

3 files changed

+19
-0
lines changed

3 files changed

+19
-0
lines changed

docs/Fixed-or-Improved-Logics.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -168,6 +168,7 @@ This page describes all ingame logics that are fixed or improved in Phobos witho
168168
- Planning paths are now shown for all units under player control or when `[GlobalControls]->DebugPlanningPaths=yes` in singleplayer game modes.
169169
- Fixed `Temporal=true` Warheads potentially crashing game if used to attack `Slaved=true` infantry.
170170
- Fixed some locomotors (Tunnel, Walk, Mech) getting stuck when moving too fast.
171+
- Animations with `MakeInfantry` and `UseNormalLight=false` that are drawn in unit palette will now have cell lighting changes applied on them (by Starkku)
171172

172173
## Fixes / interactions with other extensions
173174

docs/Whats-New.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -524,6 +524,7 @@ Vanilla fixes:
524524
- 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)
525525
- Fixed `Temporal=true` Warheads potentially crashing game if used to attack `Slaved=true` infantry (by Starkku)
526526
- Fixed some locomotors (Tunnel, Walk, Mech) getting stuck when moving too fast (by NetsuNegi)
527+
- Animations with `MakeInfantry` and `UseNormalLight=false` that are drawn in unit palette will now have cell lighting changes applied on them (by Starkku)
527528
528529
Phobos fixes:
529530
- Fixed a few errors of calling for superweapon launch by `LaunchSW` or building infiltration (by Trsdy)

src/Ext/Anim/Hooks.cpp

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -312,6 +312,23 @@ DEFINE_HOOK(0x423365, AnimClass_DrawIt_ExtraShadow, 0x8)
312312
return SkipExtraShadow;
313313
}
314314

315+
// Apply cell lighting on UseNormalLight=no MakeInfantry anims.
316+
DEFINE_HOOK(0x4232BF, AnimClass_DrawIt_MakeInfantry, 0x6)
317+
{
318+
enum { SkipGameCode = 0x4232C5 };
319+
320+
GET(AnimClass*, pThis, ESI);
321+
322+
if (pThis->Type->MakeInfantry != -1)
323+
{
324+
auto const pCell = pThis->GetCell();
325+
R->EAX(pCell->Intensity_Normal);
326+
return SkipGameCode;
327+
}
328+
329+
return 0;
330+
}
331+
315332
#pragma region AltPalette
316333

317334
// Fix AltPalette anims not using owner color scheme.

0 commit comments

Comments
 (0)