Browse Source

fixes #721

tags/v0.2.1^2
big bad waffle 5 years ago
parent
commit
fb8d860aab
3 changed files with 13 additions and 4 deletions
  1. +3
    -3
      src/client/js/components/keyboardMover.js
  2. +5
    -1
      src/client/js/components/pather.js
  3. +5
    -0
      src/server/world/instancer.js

+ 3
- 3
src/client/js/components/keyboardMover.js View File

@@ -80,10 +80,10 @@ define([
addQueue: function (x, y) {
if (this.obj.moveAnimation)
return;
else if (!this.obj.pather.add(x, y))
return;

this.obj.dirty = true;

this.obj.pather.add(x, y);
this.obj.dirty = true;

this.obj.pather.pathPos.x = x;
this.obj.pather.pathPos.y = y;


+ 5
- 1
src/client/js/components/pather.js View File

@@ -8,6 +8,7 @@ define([
var scale = 40;
var scaleMult = 5;
var round = Math.round.bind(Math);
var maxPathLength = 50;

return {
type: 'pather',
@@ -52,6 +53,9 @@ define([
},

add: function(x, y) {
if (this.path.length >= this.maxPathLength)
return;

this.path.push({
x: x,
y: y,
@@ -105,4 +109,4 @@ define([
this.pathPos.y = round(path[path.length - 1].y);
}
};
});
});

+ 5
- 0
src/server/world/instancer.js View File

@@ -194,6 +194,11 @@ define([
var obj = objects.find(o => o.serverId == msg.id);
if (!obj)
return;
else if (msg.action.action == 'move') {
var moveEntries = obj.queue.filter(q => (q.action == 'move')).length;
if (moveEntries >= 50)
return;
}

obj.queue(msg.action);
},


Loading…
Cancel
Save