Update kingofthehill.py

This commit is contained in:
Drooopyyy 2022-06-03 23:21:38 +05:30 committed by GitHub
parent b57d3c5b3e
commit 38204f7dac
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -239,11 +239,16 @@ class KingOfTheHillGame(ba.TeamGameActivity[Player, Team]):
def _handle_player_flag_region_collide(self, colliding: bool) -> None:
try:
player = ba.getcollision().opposingnode.getdelegate(
PlayerSpaz, True).getplayer(Player, True)
spaz = ba.getcollision().sourcenode.getdelegate(
PlayerSpaz, True)
except ba.NotFoundError:
return
if not spaz.is_alive():
return
player = spaz.getplayer(Player, True)
# Different parts of us can collide so a single value isn't enough
# also don't count it if we're dead (flying heads shouldn't be able to
# win the game :-)