Fixed tail of winner disappearing
This commit is contained in:
+2
-8
@@ -30,8 +30,8 @@ setInterval(function () {
|
|||||||
//main loop
|
//main loop
|
||||||
Object.keys(players).forEach(function (name) {
|
Object.keys(players).forEach(function (name) {
|
||||||
const p = players[name];
|
const p = players[name];
|
||||||
if (p.alive) {
|
if (p.alive && p.starting <= 0) {
|
||||||
if (p.starting <= 0 && !lock) {
|
if (!lock) {
|
||||||
if (!history[p.name])
|
if (!history[p.name])
|
||||||
history[p.name] = {
|
history[p.name] = {
|
||||||
i0: 0,
|
i0: 0,
|
||||||
@@ -40,12 +40,6 @@ setInterval(function () {
|
|||||||
else
|
else
|
||||||
history[p.name].i0 = (history[p.name].i0 + 1) % hsize;
|
history[p.name].i0 = (history[p.name].i0 + 1) % hsize;
|
||||||
history[p.name].list[history[p.name].i0] = clone(p.pos);
|
history[p.name].list[history[p.name].i0] = clone(p.pos);
|
||||||
} else {
|
|
||||||
history[p.name] = {
|
|
||||||
i0: 0,
|
|
||||||
list: new Array(hsize)
|
|
||||||
};
|
|
||||||
history[p.name].list[0] = clone(p.pos);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|||||||
Reference in New Issue
Block a user