1
0
mirror of https://github.com/LDDestroier/CC/ synced 2024-12-13 19:50:29 +00:00

Fixed head-on collisions being considered ties

This commit is contained in:
LDDestroier 2018-11-15 01:46:03 -05:00 committed by GitHub
parent 03d0d83b62
commit 3576ee74f2
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

19
tron
View File

@ -654,19 +654,22 @@ local moveTick = function(doSend)
if isHost then
p.x = p.x + math.floor(math.cos(math.rad(p.direction * 90)))
p.y = p.y + math.floor(math.sin(math.rad(p.direction * 90)))
end
end
if isHost then
if p.putTrail then
if doesIntersectBorder(p.x, p.y) or getTrail(p.x, p.y) then
p.dead = true
deadGuys[i] = true
elseif p.putTrail then
putTrail(p)
end
end
end
for i = 1, #player do
p = player[i]
if getTrail(p.x, p.y) or doesIntersectBorder(p.x, p.y) then
for a = 1, #player do
if (a ~= i) and (player[a].x == p.x and player[a].y == p.y) then
p.dead = true
player[a].dead = true
deadGuys[i] = true
deadGuys[a] = true
break
end
end
end
end
ageTrails()