Fix clang-analyzer-core.NonNullParamChecker

/media/ddnet/src/game/server/entities/projectile.cpp:201:37: warning: Forming reference to null pointer [clang-analyzer-core.NonNullParamChecker]
                                        Found = GetNearestAirPosPlayer(pTargetChr->m_Pos, &PossiblePos);
                                                                       ^
This commit is contained in:
def 2020-10-12 16:23:09 +02:00
parent 5c1b8cd221
commit 98d4baabed

View file

@ -198,7 +198,7 @@ void CProjectile::Tick()
vec2 PossiblePos;
if(!Collide)
Found = GetNearestAirPosPlayer(pTargetChr->m_Pos, &PossiblePos);
Found = GetNearestAirPosPlayer(pTargetChr ? pTargetChr->m_Pos : ColPos, &PossiblePos);
else
Found = GetNearestAirPos(NewPos, CurPos, &PossiblePos);