diff --git a/scripts/vscripts/ZombieReborn.lua b/scripts/vscripts/ZombieReborn.lua index c5d2e8d..12ffedb 100644 --- a/scripts/vscripts/ZombieReborn.lua +++ b/scripts/vscripts/ZombieReborn.lua @@ -157,6 +157,14 @@ end function OnPlayerTeam(event) --__DumpScope(0, event) local hPlayer = EHandleToHScript(event.userid_pawn) + + local tThrewnNades = Entities:FindAllByClassname("hegrenade_projectile") + for __, hProjectile in ipairs(tThrewnNades) do + if hProjectile and hProjectile:GetOwner() == hPlayer then + DoEntFireByInstanceHandle(hProjectile, "Kill", "", 0.02, nil, nil) + end + end + if ZR_ZOMBIE_SPAWNED and event.team == CS_TEAM_CT and tCureList[hPlayer] == nil then --SetTeam doesn't work on the same tick as well :pepemeltdown: DoEntFireByInstanceHandle(hPlayer, "runscriptcode", "thisEntity:SetTeam(CS_TEAM_NONE); thisEntity:SetTeam(CS_TEAM_T)", 0.01, nil, nil) diff --git a/scripts/vscripts/ZombieReborn/Infect.lua b/scripts/vscripts/ZombieReborn/Infect.lua index f111698..7f0403f 100644 --- a/scripts/vscripts/ZombieReborn/Infect.lua +++ b/scripts/vscripts/ZombieReborn/Infect.lua @@ -39,13 +39,6 @@ function Infect(hInflictor, hInfected, bKeepPosition, bDead) end end - local tThrewnNades = Entities:FindAllByClassname("hegrenade_projectile") - for __, hProjectile in ipairs(tThrewnNades) do - if hProjectile and hProjectile:GetOwner() == hInfected then - DoEntFireByInstanceHandle(hProjectile, "Kill", "", 0.02, nil, nil) - end - end - DebugPrint("Setting regular zombie class") InjectPlayerClass(PickRandomZombieDefaultClass(), hInfected) @@ -82,13 +75,6 @@ function InfectMotherZombie(hInfected, bKeepPosition) end end - local tThrewnNades = Entities:FindAllByClassname("hegrenade_projectile") - for __, hProjectile in ipairs(tThrewnNades) do - if hProjectile and hProjectile:GetOwner() == hInfected then - DoEntFireByInstanceHandle(hProjectile, "Kill", "", 0.02, nil, nil) - end - end - DebugPrint("Setting mother zombie class") InjectPlayerClass(ZRClass.Zombie.MotherZombie, hInfected)