sanitize packets
This commit is contained in:
parent
13cd3db387
commit
4f4328e163
2 changed files with 12 additions and 2 deletions
1
game.js
1
game.js
|
@ -19,6 +19,7 @@ class Game extends GameBasic {
|
|||
for (let entity of entities) {
|
||||
entity.pos = { x: Math.round(entity.pos.x), y: Math.round(entity.pos.y) };
|
||||
entity.vel = { x: Math.round(entity.vel.x), y: Math.round(entity.vel.y) };
|
||||
entity.camera = entity.camera ? { x: Math.round(entity.camera.x), y: Math.round(entity.camera.y) } : false;
|
||||
|
||||
let props = entity.serverProps;
|
||||
let basic = props.map(prop => entity[prop]);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue