mirror of
https://github.com/1dot13/source.git
synced 2026-08-05 14:00:23 +02:00
Prevent illegal array access if GridNo = NOWHERE (#93)
This commit is contained in:
@@ -1034,6 +1034,11 @@ inline UINT16 * GetShadeTable(LEVELNODE * pNode, SOLDIERTYPE * pSoldier, SOLDIER
|
||||
// Shade guy always lighter than scene default!
|
||||
{
|
||||
const auto GridNo = pSoldier->sGridNo;
|
||||
if (GridNo == NOWHERE)
|
||||
{
|
||||
pShadeTable = pPaletteTable->pCurrentShade = pPaletteTable->pShades[DEFAULT_SHADE_LEVEL];
|
||||
return pShadeTable;
|
||||
}
|
||||
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)
|
||||
|
||||
Reference in New Issue
Block a user