From 6a6b8da999d037a42b0da4aadb574463b5f13045 Mon Sep 17 00:00:00 2001 From: Michael Fabian 'Xaymar' Dirks Date: Thu, 5 Jul 2018 06:56:44 +0200 Subject: [PATCH] gamemode/server: Fix prop rotation messages appearing without debug log Also adds the intended angle and player initiating the action --- .../gamemodes/prophuntextended/gamemode/init.lua | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/source/gamemodes/prophuntextended/gamemode/init.lua b/source/gamemodes/prophuntextended/gamemode/init.lua index 2448261..39fd2a4 100644 --- a/source/gamemodes/prophuntextended/gamemode/init.lua +++ b/source/gamemodes/prophuntextended/gamemode/init.lua @@ -394,15 +394,23 @@ net.Receive("PlayerEnablePropRotation", function(len, ply) if (ply:Team() != GAMEMODE.Teams.Hiders) then return end - print("Prop Hunt: Enabling Prop Rotation") + + angle = net.ReadAngle() + ply:SetNWBool("PropRotation", true) - ply.Data.Prop:ApplyRotation(net.ReadAngle()) + ply.Data.Prop:ApplyRotation(angle) + + if GAMEMODE.Config:DebugLog() then print("Prop Hunt: Player '"..ply:GetName().."' (SteamID: "..ply:SteamID()..") enabled prop rotation with angle ["..tostring(angle).."].") end end) net.Receive("PlayerDisablePropRotation", function(len, ply) if (ply:Team() != GAMEMODE.Teams.Hiders) then return end - print("Prop Hunt: Disabling Prop Rotation") + + angle = net.ReadAngle() + ply:SetNWBool("PropRotation", false) - ply.Data.Prop:ApplyRotation(net.ReadAngle()) + ply.Data.Prop:ApplyRotation(angle) + + if GAMEMODE.Config:DebugLog() then print("Prop Hunt: Player '"..ply:GetName().."' (SteamID: "..ply:SteamID()..") enabled prop rotation with angle ["..tostring(angle).."].") end end) \ No newline at end of file