Skip to content

Commit 1c121d0

Browse files
committed
Fix SkirmishUnlimitedColors always being in effect if Ares is not active
1 parent b42d10f commit 1c121d0

File tree

3 files changed

+28
-18
lines changed

3 files changed

+28
-18
lines changed

Phobos.vcxproj

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -189,7 +189,6 @@
189189
<ClCompile Include="src\Misc\Hooks.LaserDraw.cpp" />
190190
<ClCompile Include="src\Misc\Hooks.Timers.cpp" />
191191
<ClCompile Include="src\Misc\Hooks.INIInheritance.cpp" />
192-
<ClCompile Include="src\Misc\Hooks.SkirmishColors.cpp" />
193192
<ClCompile Include="src\Misc\Hooks.Overlay.cpp" />
194193
<ClCompile Include="src\Misc\Hooks.Message.cpp" />
195194
<ClCompile Include="src\New\Type\Affiliated\TypeConvertGroup.cpp" />

src/Misc/Hooks.SkirmishColors.cpp

Lines changed: 0 additions & 17 deletions
This file was deleted.

src/Misc/Hooks.UI.cpp

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -400,3 +400,31 @@ DEFINE_FUNCTION_JUMP(CALL, 0x63B100, Fake_HouseIsAlliedWith);
400400
DEFINE_FUNCTION_JUMP(CALL, 0x63B17F, Fake_HouseIsAlliedWith);
401401
DEFINE_FUNCTION_JUMP(CALL, 0x63B1BA, Fake_HouseIsAlliedWith);
402402
DEFINE_FUNCTION_JUMP(CALL, 0x63B2CE, Fake_HouseIsAlliedWith);
403+
404+
DEFINE_HOOK(0x69A317, SessionClass_PlayerColorIndexToColorSchemeIndex, 0x0)
405+
{
406+
GET_STACK(int, index, 0x4);
407+
408+
bool isRandom = index == PlayerColorSlot::Random;
409+
410+
if (Phobos::Config::SkirmishUnlimitedColors)
411+
{
412+
// Allow player color indices to map directly to color scheme indices.
413+
if (isRandom)
414+
index = ColorScheme::FindIndex("LightGrey", 53);
415+
else
416+
index = index * 2 + 1;
417+
}
418+
else
419+
{
420+
// Vanilla behaviour.
421+
if (isRandom)
422+
index = ColorScheme::PlayerColorToColorSchemeLUT[PlayerColorSlot::White];
423+
else
424+
index = ColorScheme::PlayerColorToColorSchemeLUT[index];
425+
}
426+
427+
R->EAX(index);
428+
429+
return 0x69A325;
430+
}

0 commit comments

Comments
 (0)