From fa9bbaabfa67d2119d6c1d7ac089594f3add60d0 Mon Sep 17 00:00:00 2001 From: LDDestroier Date: Thu, 15 Nov 2018 00:03:37 -0500 Subject: [PATCH] Tried to counter weird turning for P2 --- tron | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/tron b/tron index 9ae1aa6..84d2281 100644 --- a/tron +++ b/tron @@ -683,6 +683,9 @@ local setDirection = function(keylist, p) end end +-- to counter P2's ability to turn twice in one tick +local inMidTurn = false + local game = function() local outcome local p, np @@ -690,9 +693,13 @@ local game = function() p = player[you] np = player[nou] - setDirection(keysDown, p) + if isHost then + setDirection(keysDown, p) setDirection(netKeysDown, np) + elseif not inMidTurn then + setDirection(keysDown, p) + inMidTurn = true end if keysDown[control.lookLeft] then @@ -764,6 +771,7 @@ local networking = function() player = msg.player trail = msg.trail deadGuys = msg.deadGuys + inMidTurn = false elseif type(msg.keysDown) == "table" then netKeysDown = msg.keysDown end