Skip to content

Commit a26b3e6

Browse files
committed
Fix color value
1 parent 837354d commit a26b3e6

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

Client/mods/deathmatch/logic/CClient2DFXManager.cpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -117,8 +117,8 @@ bool CClient2DFXManager::Set2DFXProperties(C2DEffectSAInterface* effect, const e
117117
light.offsetZ = static_cast<std::int8_t>(std::get<float>(*offsetZ));
118118

119119
auto* color = MapFind(effectData, "color");
120-
int colorValue = static_cast<int>(std::get<float>(*color));
121-
light.color = RwColor{static_cast<std::uint8_t>((colorValue >> 0) & mask(8)), static_cast<std::uint8_t>((colorValue >> 8) & mask(8)), static_cast<std::uint8_t>((colorValue >> 16) & mask(8)), static_cast<std::uint8_t>((colorValue >> 24) & mask(8))};
120+
unsigned long colorValue = static_cast<unsigned long>(std::get<float>(*color));
121+
light.color = RwColor{static_cast<std::uint8_t>((colorValue >> 16) & mask(8)), static_cast<std::uint8_t>((colorValue >> 8) & mask(8)), static_cast<std::uint8_t>((colorValue >> 0) & mask(8)), static_cast<std::uint8_t>((colorValue >> 24) & mask(8))};
122122

123123
auto* coronaTexture = MapFind(effectData, "coronaName");
124124
auto* shadowTexture = MapFind(effectData, "shadowName");
@@ -416,8 +416,8 @@ bool CClient2DFXManager::Set2DFXProperty(C2DEffectSAInterface* effect, const e2d
416416
{
417417
if (std::holds_alternative<float>(propertyValue))
418418
{
419-
int colorValue = static_cast<int>(std::get<float>(propertyValue));
420-
light.color = RwColor{static_cast<std::uint8_t>((colorValue >> 0) & mask(8)), static_cast<std::uint8_t>((colorValue >> 8) & mask(8)), static_cast<std::uint8_t>((colorValue >> 16) & mask(8)), static_cast<std::uint8_t>((colorValue >> 24) & mask(8))};
419+
unsigned long colorValue = static_cast<unsigned long>(std::get<float>(propertyValue));
420+
light.color = RwColor{static_cast<std::uint8_t>((colorValue >> 16) & mask(8)), static_cast<std::uint8_t>((colorValue >> 8) & mask(8)), static_cast<std::uint8_t>((colorValue >> 0) & mask(8)), static_cast<std::uint8_t>((colorValue >> 24) & mask(8))};
421421

422422
return true;
423423
}

0 commit comments

Comments
 (0)