Permalink
Browse files

Fix cell edits and deletes

  • Loading branch information...
1 parent 9849d51 commit 0b555b49a55af09af58012110eaf00cec097f4c7 @yohcop committed Aug 9, 2011
Showing with 3 additions and 2 deletions.
  1. +1 −0 src/client-js/static/comm.js
  2. +2 −2 src/client-js/static/player.js
@@ -170,6 +170,7 @@ Websockets.prototype.reloadChunk = function(chunkY, chunkX) {
/** @private */
Websockets.prototype._receiveMessage = function(data) {
+ data = data.replace(/^\s+|\s+$/g, '');
var parts = data.split(" ");
if(parts[0] == "m" && parts.length == 7) {
var chunkY = parseInt(parts[1]);
@@ -124,9 +124,9 @@ Player.prototype._destroy = function(c) {
if (this._world.isLiveChunk(c[0], c[1])) {
var current = this._world.getCell(c[0], c[1], c[2] + 1, c[3], c[4]);
if (!this._world.isEmpty(current)) {
- this._comm.setCell(c[0], c[1], c[2] + 1, c[3], c[4], "");
+ this._comm.setCell(c[0], c[1], c[2] + 1, c[3], c[4], "0");
} else {
- this._comm.setCell(c[0], c[1], c[2], c[3], c[4], "");
+ this._comm.setCell(c[0], c[1], c[2], c[3], c[4], "0");
}
}
this._renderer.setDirty();

0 comments on commit 0b555b4

Please sign in to comment.