chore: disable killcams if attacker is a bot
All checks were successful
lint / Lint GSC files (push) Successful in 28s

This commit is contained in:
2025-07-28 15:59:36 +02:00
parent 1bc8e95f5a
commit 1d680fbfde
2 changed files with 26 additions and 11 deletions

View File

@@ -2,6 +2,9 @@ main()
{
replacefunc( maps\mp\_utility::getlastlivingplayer, ::getlastlivingplayer_stub );
replacefunc( maps\mp\gametypes\common_sd_sr::ononeleftevent, ::ononeleftevent_stub );
// gitea#5 workaround
replacefunc( maps\mp\gametypes\_killcam::killcamvalid, ::killcamvalid_stub );
}
getlastlivingplayer_stub( team )
@@ -36,3 +39,12 @@ ononeleftevent_stub( team )
last_player thread maps\mp\gametypes\common_sd_sr::givelastonteamwarning();
}
killcamvalid_stub( victim, attacker, dokillcam )
{
return dokillcam && level.killcam &&
!( isdefined( victim.cancelkillcam ) && victim.cancelkillcam ) &&
game[ "state" ] == "playing" && !victim maps\mp\_utility::isusingremote() &&
!level.showingfinalkillcam &&
!isai( victim ) && !isai( attacker );
}