mirror of
https://github.com/1dot13/source.git
synced 2026-08-26 14:30:26 +02:00
speed up handling of personal light
git-svn-id: https://ja2svn.mooo.com/source/ja2/trunk/GameSource/ja2_v1.13/Build@6068 3b4a5df2-a311-0410-b5c6-a8a6f20db521
This commit is contained in:
@@ -16284,12 +16284,17 @@ void SOLDIERTYPE::HandleFlashLights()
|
|||||||
if ( !NightTime() && !gbWorldSectorZ )
|
if ( !NightTime() && !gbWorldSectorZ )
|
||||||
return;
|
return;
|
||||||
|
|
||||||
|
// take note of wether we changed light
|
||||||
|
BOOLEAN fLightChanged = FALSE;
|
||||||
|
|
||||||
// remove existing lights we 'own'
|
// remove existing lights we 'own'
|
||||||
if ( this->bSoldierFlagMask & SOLDIER_LIGHT_OWNER )
|
if ( this->bSoldierFlagMask & SOLDIER_LIGHT_OWNER )
|
||||||
{
|
{
|
||||||
RemovePersonalLights( this->ubID );
|
RemovePersonalLights( this->ubID );
|
||||||
|
|
||||||
this->bSoldierFlagMask &= ~SOLDIER_LIGHT_OWNER;
|
this->bSoldierFlagMask &= ~SOLDIER_LIGHT_OWNER;
|
||||||
|
|
||||||
|
fLightChanged = TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
// not possible to get this bonus on a roof, due to our lighting system
|
// not possible to get this bonus on a roof, due to our lighting system
|
||||||
@@ -16360,13 +16365,18 @@ void SOLDIERTYPE::HandleFlashLights()
|
|||||||
|
|
||||||
// take note: we own a light source
|
// take note: we own a light source
|
||||||
this->bSoldierFlagMask |= SOLDIER_LIGHT_OWNER;
|
this->bSoldierFlagMask |= SOLDIER_LIGHT_OWNER;
|
||||||
|
|
||||||
|
fLightChanged = TRUE;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// refresh sight for everybody
|
if ( fLightChanged )
|
||||||
AllTeamsLookForAll( TRUE );
|
{
|
||||||
|
// refresh sight for everybody
|
||||||
|
AllTeamsLookForAll( TRUE );
|
||||||
|
|
||||||
SetRenderFlags(RENDER_FLAG_FULL);
|
SetRenderFlags(RENDER_FLAG_FULL);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
UINT8 SOLDIERTYPE::GetBestEquippedFlashLightRange()
|
UINT8 SOLDIERTYPE::GetBestEquippedFlashLightRange()
|
||||||
|
|||||||
Reference in New Issue
Block a user