Update: CC - Snake FS - Entity Loaded (21g30t1e75.js) 65 bytes modified

beta.r3js.org
-=yb4f310 2018-03-24 11:15:13 +01:00
parent 40311bb233
commit 0b72479c81
1 changed files with 14 additions and 12 deletions

View File

@ -833,7 +833,9 @@ GameLib.CustomCode.SnakeBody.prototype = Object.create(GameLib.CustomCode.GameOb
GameLib.CustomCode.SnakeBody.prototype.constructor = GameLib.CustomCode.GameObject;
GameLib.CustomCode.SnakeBody.prototype.dispose = function() {
GameLib.CustomCode.GameObject.prototype.dispose.call(this);
if (this.backupMesh) {
this.backupMesh.geometry = null;
this.backupMesh.materials = null;
@ -1152,7 +1154,7 @@ GameLib.CustomCode.prototype.createCorner = function(body, temp) {
GameLib.CustomCode.prototype.backup = function() {
this.backup = {
this.backupState = {
snake : this.snake.map(
function(body) {
return body.clone();
@ -1178,7 +1180,7 @@ GameLib.CustomCode.prototype.restore = function() {
var meshFound = false;
var backupMeshFound = false;
this.backup.snake.map(
this.backupState.snake.map(
function (backupBody) {
if (
body.mesh === backupBody.mesh ||
@ -1222,9 +1224,9 @@ GameLib.CustomCode.prototype.restore = function() {
/**
* Restore our backup
*/
this.state.orientation = this.backup.orientation;
this.state.flip = this.backup.flip;
this.snake = this.backup.snake.map(
this.state.orientation = this.backupState.orientation;
this.state.flip = this.backupState.flip;
this.snake = this.backupState.snake.map(
function(body) {
var clone = body.clone();