From 3249ff5fac1ba456a096406adfca49ff27edea88 Mon Sep 17 00:00:00 2001 From: Mka0207 Date: Sun, 17 Mar 2019 23:31:18 -0400 Subject: [PATCH 1/6] ZombieVision moved to clientside. remove lag when people with high ping toggle zvision. --- .../zombiesurvival/gamemode/cl_postprocess.lua | 13 ++++++++++--- gamemodes/zombiesurvival/gamemode/init.lua | 6 ------ 2 files changed, 10 insertions(+), 9 deletions(-) diff --git a/gamemodes/zombiesurvival/gamemode/cl_postprocess.lua b/gamemodes/zombiesurvival/gamemode/cl_postprocess.lua index e5efad4..0d07ce9 100644 --- a/gamemodes/zombiesurvival/gamemode/cl_postprocess.lua +++ b/gamemodes/zombiesurvival/gamemode/cl_postprocess.lua @@ -260,9 +260,16 @@ function GM:ToggleZombieVision(onoff) end end -net.Receive("zs_togglezvision", function(length) - gamemode.Call("ToggleZombieVision") -end) +function GM:PlayerButtonDown( ply, button ) + if not IsFirstTimePredicted() then return end + if not IsValid( ply ) or ply != MySelf then return end + + if ply:Team() == TEAM_UNDEAD and ply:Alive() then + if button == KEY_F then + self:ToggleZombieVision() + end + end +end local CModWhiteOut = { ["$pp_colour_addr"] = 0, diff --git a/gamemodes/zombiesurvival/gamemode/init.lua b/gamemodes/zombiesurvival/gamemode/init.lua index e034c7f..6904402 100644 --- a/gamemodes/zombiesurvival/gamemode/init.lua +++ b/gamemodes/zombiesurvival/gamemode/init.lua @@ -474,7 +474,6 @@ function GM:AddNetworkStrings() util.AddNetworkString("zs_deployableout") util.AddNetworkString("zs_trinketconsumed") util.AddNetworkString("zs_nailremoved") - util.AddNetworkString("zs_togglezvision") util.AddNetworkString("zs_remantlercontent") util.AddNetworkString("zs_classunlockstate") util.AddNetworkString("zs_changeclass") @@ -4314,11 +4313,6 @@ end function GM:PlayerSwitchFlashlight(pl, newstate) if pl:Team() == TEAM_UNDEAD then - if newstate then - net.Start("zs_togglezvision") - net.Send(pl) - end - return false end From e881e4e5881481f8a8ba29751f0b6c901c3e39e1 Mon Sep 17 00:00:00 2001 From: Mka0207 Date: Mon, 18 Mar 2019 15:07:36 -0400 Subject: [PATCH 2/6] ZombieVision now based on bind. --- gamemodes/zombiesurvival/gamemode/cl_init.lua | 8 ++++++++ gamemodes/zombiesurvival/gamemode/cl_postprocess.lua | 11 ----------- 2 files changed, 8 insertions(+), 11 deletions(-) diff --git a/gamemodes/zombiesurvival/gamemode/cl_init.lua b/gamemodes/zombiesurvival/gamemode/cl_init.lua index cf234e3..3c883de 100644 --- a/gamemodes/zombiesurvival/gamemode/cl_init.lua +++ b/gamemodes/zombiesurvival/gamemode/cl_init.lua @@ -2240,3 +2240,11 @@ end function PlayMenuCloseSound() MySelf:EmitSound("buttons/lightswitch2.wav", 100, 20) end + +function GM:PlayerBindPress(ply, bind, pressed) + if IsValid( ply ) and ply:Team() == TEAM_UNDEAD and ply:Alive() and not IsFirstTimePredicted() then + if (bind == "impulse 100") then + self:ToggleZombieVision() + end + end +end \ No newline at end of file diff --git a/gamemodes/zombiesurvival/gamemode/cl_postprocess.lua b/gamemodes/zombiesurvival/gamemode/cl_postprocess.lua index 0d07ce9..4813893 100644 --- a/gamemodes/zombiesurvival/gamemode/cl_postprocess.lua +++ b/gamemodes/zombiesurvival/gamemode/cl_postprocess.lua @@ -260,17 +260,6 @@ function GM:ToggleZombieVision(onoff) end end -function GM:PlayerButtonDown( ply, button ) - if not IsFirstTimePredicted() then return end - if not IsValid( ply ) or ply != MySelf then return end - - if ply:Team() == TEAM_UNDEAD and ply:Alive() then - if button == KEY_F then - self:ToggleZombieVision() - end - end -end - local CModWhiteOut = { ["$pp_colour_addr"] = 0, ["$pp_colour_addg"] = 0, From f79846b7adf7639c149ebae40b2c0df1e5fc6baa Mon Sep 17 00:00:00 2001 From: Mka0207 Date: Mon, 18 Mar 2019 15:18:49 -0400 Subject: [PATCH 3/6] Merged bindpress funcs. --- gamemodes/zombiesurvival/gamemode/cl_init.lua | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) diff --git a/gamemodes/zombiesurvival/gamemode/cl_init.lua b/gamemodes/zombiesurvival/gamemode/cl_init.lua index 3c883de..38fbf01 100644 --- a/gamemodes/zombiesurvival/gamemode/cl_init.lua +++ b/gamemodes/zombiesurvival/gamemode/cl_init.lua @@ -1780,6 +1780,10 @@ function GM:PlayerBindPress(pl, bind, wasin) elseif P_Team(pl) == TEAM_HUMAN then self:ToggleOTSCamera() end + elseif bind == "impulse 100" then + if P_Team(pl) == TEAM_UNDEAD and pl:Alive() then + self:ToggleZombieVision() + end end end @@ -2239,12 +2243,4 @@ end function PlayMenuCloseSound() MySelf:EmitSound("buttons/lightswitch2.wav", 100, 20) -end - -function GM:PlayerBindPress(ply, bind, pressed) - if IsValid( ply ) and ply:Team() == TEAM_UNDEAD and ply:Alive() and not IsFirstTimePredicted() then - if (bind == "impulse 100") then - self:ToggleZombieVision() - end - end end \ No newline at end of file From e89f99a5cea12930050170976d909bb959d27750 Mon Sep 17 00:00:00 2001 From: William Moodhe Date: Mon, 18 Mar 2019 16:52:35 -0400 Subject: [PATCH 4/6] Remove gamemode-wide punishments to steamids --- gamemodes/zombiesurvival/gamemode/init.lua | 5 ----- gamemodes/zombiesurvival/gamemode/sh_globals.lua | 11 ----------- 2 files changed, 16 deletions(-) diff --git a/gamemodes/zombiesurvival/gamemode/init.lua b/gamemodes/zombiesurvival/gamemode/init.lua index e034c7f..a60ac03 100644 --- a/gamemodes/zombiesurvival/gamemode/init.lua +++ b/gamemodes/zombiesurvival/gamemode/init.lua @@ -2200,11 +2200,6 @@ function GM:PlayerInitialSpawnRound(pl) local uniqueid = pl:UniqueID() - if table.HasValue(self.FanList, uniqueid) then - pl.DamageVulnerability = (pl.DamageVulnerability or 1) + 10 - pl:PrintTranslatedMessage(HUD_PRINTTALK, "thanks_for_being_a_fan_of_zs") - end - if self.PreviouslyDied[uniqueid] or ZSBOT then -- They already died and reconnected. pl:ChangeTeam(TEAM_UNDEAD) diff --git a/gamemodes/zombiesurvival/gamemode/sh_globals.lua b/gamemodes/zombiesurvival/gamemode/sh_globals.lua index f75e4a1..114086c 100644 --- a/gamemodes/zombiesurvival/gamemode/sh_globals.lua +++ b/gamemodes/zombiesurvival/gamemode/sh_globals.lua @@ -327,14 +327,3 @@ GM.ValidBeaconMessages = { "message_beacon_24", "message_beacon_25" } - -GM.FanList = { - "1418945843", - "1595085577", - "3311458935", - "3023059541", - "2000875318", - "778584317", - "6086255", - "2867054481" -} From c63f0155ff6f88c11e0f375ee79b358aa2b0d45c Mon Sep 17 00:00:00 2001 From: Mka0207 Date: Mon, 18 Mar 2019 18:30:04 -0400 Subject: [PATCH 5/6] Fixed indentation --- gamemodes/zombiesurvival/gamemode/cl_init.lua | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/gamemodes/zombiesurvival/gamemode/cl_init.lua b/gamemodes/zombiesurvival/gamemode/cl_init.lua index 38fbf01..6dee1be 100644 --- a/gamemodes/zombiesurvival/gamemode/cl_init.lua +++ b/gamemodes/zombiesurvival/gamemode/cl_init.lua @@ -1780,10 +1780,10 @@ function GM:PlayerBindPress(pl, bind, wasin) elseif P_Team(pl) == TEAM_HUMAN then self:ToggleOTSCamera() end - elseif bind == "impulse 100" then + elseif bind == "impulse 100" then if P_Team(pl) == TEAM_UNDEAD and pl:Alive() then - self:ToggleZombieVision() - end + self:ToggleZombieVision() + end end end @@ -2243,4 +2243,4 @@ end function PlayMenuCloseSound() MySelf:EmitSound("buttons/lightswitch2.wav", 100, 20) -end \ No newline at end of file +end From c0488207c48e48f463f914fb79083eed4c862143 Mon Sep 17 00:00:00 2001 From: William Moodhe Date: Mon, 18 Mar 2019 18:55:04 -0400 Subject: [PATCH 6/6] Fix --- gamemodes/zombiesurvival/gamemode/cl_init.lua | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/gamemodes/zombiesurvival/gamemode/cl_init.lua b/gamemodes/zombiesurvival/gamemode/cl_init.lua index 6dee1be..8b6c9b3 100644 --- a/gamemodes/zombiesurvival/gamemode/cl_init.lua +++ b/gamemodes/zombiesurvival/gamemode/cl_init.lua @@ -1780,10 +1780,10 @@ function GM:PlayerBindPress(pl, bind, wasin) elseif P_Team(pl) == TEAM_HUMAN then self:ToggleOTSCamera() end - elseif bind == "impulse 100" then + elseif bind == "impulse 100" then if P_Team(pl) == TEAM_UNDEAD and pl:Alive() then - self:ToggleZombieVision() - end + self:ToggleZombieVision() + end end end