mirror of
https://github.com/1dot13/source.git
synced 2026-07-22 13:40:22 +02:00
This fixes player mercs' shading not updating based on the tile's lightlevel. Especially noticeable when running around at night in a map with lights (by Asdow).
git-svn-id: https://ja2svn.mooo.com/source/ja2/trunk/GameSource/ja2_v1.13/Build@9211 3b4a5df2-a311-0410-b5c6-a8a6f20db521
This commit is contained in:
@@ -1043,12 +1043,21 @@ void RenderSetShadows(BOOLEAN fShadows)
|
||||
inline UINT16 * GetShadeTable(LEVELNODE * pNode, SOLDIERTYPE * pSoldier, SOLDIERTYPE * pPaletteTable, UINT32 uiFlags, INT16 * gsForceSoldierZLevel)
|
||||
{
|
||||
UINT16 * pShadeTable;
|
||||
// Shade guy always lighter than sceane default!
|
||||
// Shade guy always lighter than scene default!
|
||||
{
|
||||
UINT8 ubShadeLevel;
|
||||
ubShadeLevel = (pNode->ubShadeLevel & 0x0f);
|
||||
const auto GridNo = pSoldier->sGridNo;
|
||||
UINT8 ubShadeLevel = gpWorldLevelData[GridNo].pLandHead->ubShadeLevel;
|
||||
// If merc is on a roof, shade according to roof brightness
|
||||
if (pSoldier->pathing.bLevel > 0 && gpWorldLevelData[GridNo].pRoofHead != NULL)
|
||||
{
|
||||
ubShadeLevel = gpWorldLevelData[GridNo].pRoofHead->ubShadeLevel;
|
||||
}
|
||||
|
||||
ubShadeLevel = (ubShadeLevel & 0x0f);
|
||||
ubShadeLevel = __max(ubShadeLevel - 2, DEFAULT_SHADE_LEVEL);
|
||||
ubShadeLevel |= (pNode->ubShadeLevel & 0x30);
|
||||
ubShadeLevel |= (ubShadeLevel & 0x30);
|
||||
|
||||
|
||||
if (pSoldier->flags.fBeginFade)
|
||||
{
|
||||
pShadeTable = pPaletteTable->pCurrentShade = pPaletteTable->pShades[pSoldier->ubFadeLevel];
|
||||
|
||||
Reference in New Issue
Block a user