mirror of
https://github.com/1dot13/source.git
synced 2026-09-16 14:47:17 +02:00
Move nullptr check to be checked first
Kinda defeats the purpose of checking for nullptr if we dereference it before the check, no?
This commit is contained in:
@@ -1993,8 +1993,8 @@ INT32 GetTotalFacilityHourlyCosts( BOOLEAN fPositive )
|
|||||||
pSoldier = gCharactersList[ ubCounter ].usSolID;
|
pSoldier = gCharactersList[ ubCounter ].usSolID;
|
||||||
|
|
||||||
// Is character truly valid?
|
// Is character truly valid?
|
||||||
if( !( pSoldier->flags.uiStatusFlags & SOLDIER_VEHICLE ) &&
|
if( pSoldier != NULL && !( pSoldier->flags.uiStatusFlags & SOLDIER_VEHICLE ) &&
|
||||||
pSoldier->bSectorZ == 0 && pSoldier != NULL &&
|
pSoldier->bSectorZ == 0 &&
|
||||||
pSoldier->stats.bLife >= OKLIFE &&
|
pSoldier->stats.bLife >= OKLIFE &&
|
||||||
!(pSoldier->flags.fMercAsleep) )
|
!(pSoldier->flags.fMercAsleep) )
|
||||||
{
|
{
|
||||||
|
|||||||
Reference in New Issue
Block a user