cops only shoot characters on the same screen as them (fixes issue #79)

This commit is contained in:
pennyrigate 2023-04-13 11:12:42 -04:00
parent 3e51a5062f
commit 8ac962d855

View file

@ -44,6 +44,7 @@ func _physics_process(delta):
# check for player in raycast
var collider = shoot_cast.get_collider()
if collider != null && (collider.is_in_group("player") or collider.is_in_group("msx")):
if Game.get_sector(global_position) == Game.get_sector(collider.global_position):
# kill player and enter shooting state temporarily
collider.get_parent().die()
# play sound