public static Pawn AnyHostileActive() { var maps = Find.Maps; if (maps != null) { foreach (var map in maps) { if (HostileHandler.AnyHostileActiveThreatTo(map, Faction.OfPlayer, out var threat, false)) { if (threat.Thing is Pawn p) { return(p); } } } } return(null); }
public static void UpdateHostilesLong() { var maps = Find.Maps; if (maps == null) { return; } foreach (var map in maps) { if (HostileHandler.AnyHostileActiveThreatTo(map, Faction.OfPlayer, out var threat)) { if (threat.Thing is Pawn p) { _hostilePawnsCached.Add(p); } } } }