Currently I am using this bit of code for that:
Code: Select all
function bool PlayerOn()
{
local pawn P;
for ( P=Level.PawnList; P!=None; P=P.nextPawn )
if (PlayerPawn(P) != None) return true;
return false;
}
called in a Timer function, and would like to make it as optimal as possible. (Performance-wise)
*Edit:
Is there a way to rewrite that function so it traverses the PawnList backwards?
Occurs to me that any player pawns would be at or near the end of the list.
Could bypass all the default pawns in the map/game with this check if the list could
be processed backwards. (I think..... )