1
0
mirror of https://github.com/LDDestroier/CC/ synced 2024-06-16 18:29:58 +00:00

Tried to counter weird turning for P2

This commit is contained in:
LDDestroier 2018-11-15 00:03:37 -05:00 committed by GitHub
parent 30bf688423
commit fa9bbaabfa
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

10
tron
View File

@ -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