Permalink
Browse files

TTT: fix spectator mode not syncing after level change

Should fix problem with spectator mode losing its effect after a map
switch, introduced by 4780d87.

When sent in `Initialize`, the net msg didn't seem to actually arrive.
We don't actually need it to be that early in the process, and moving it
to `InitPostEntity` works.
  • Loading branch information...
svdm committed Jan 8, 2017
1 parent 230d080 commit 648d5c7c221c815b1d6512fc23913408932a0db9
Showing with 4 additions and 4 deletions.
  1. +4 −4 garrysmod/gamemodes/terrortown/gamemode/cl_init.lua
@@ -51,15 +51,15 @@ function GM:Initialize()
LANG.Init()
self.BaseClass:Initialize()
net.Start("TTT_Spectate")
net.WriteBool(GetConVar("ttt_spectator_mode"):GetBool())
net.SendToServer()
end
function GM:InitPostEntity()
MsgN("TTT Client post-init...")
net.Start("TTT_Spectate")
net.WriteBool(GetConVar("ttt_spectator_mode"):GetBool())
net.SendToServer()
if not game.SinglePlayer() then
timer.Create("idlecheck", 5, 0, CheckIdle)
end

1 comment on commit 648d5c7

@comedinha

This comment has been minimized.

Contributor

comedinha commented on 648d5c7 Jan 9, 2017

👍

Please sign in to comment.