Type bug in implementation of #35
This commit is contained in:
@@ -350,7 +350,7 @@ var AISprite = function(game, x, y, key, frame) {
|
|||||||
if ( hasBeenReset == true )
|
if ( hasBeenReset == true )
|
||||||
return;
|
return;
|
||||||
if ( game.physics.arcade.overlap(spr, this) ) {
|
if ( game.physics.arcade.overlap(spr, this) ) {
|
||||||
var last = this.path[this.path.length() - 1];
|
var last = this.path[this.path.length - 1];
|
||||||
this.path_tween_stop();
|
this.path_tween_stop();
|
||||||
hasBeenReset = true;
|
hasBeenReset = true;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -357,7 +357,12 @@ GameState.prototype.update = function()
|
|||||||
delState(player, STATE_STEALING);
|
delState(player, STATE_STEALING);
|
||||||
x.sprite_has_treasure = false;
|
x.sprite_has_treasure = false;
|
||||||
var stolen = moonlightTreasures[x.sprite_treasure];
|
var stolen = moonlightTreasures[x.sprite_treasure];
|
||||||
|
if ( typeof stolen == 'undefined' ) {
|
||||||
|
// You should put a trap here.
|
||||||
|
console.log("Tried to steal undefined : " + x.sprite_treasure);
|
||||||
|
} else {
|
||||||
player.score += stolen['value'];
|
player.score += stolen['value'];
|
||||||
|
}
|
||||||
x.sprite_treasure = null;
|
x.sprite_treasure = null;
|
||||||
if ( this.recentlyStolenGroup.total >= RECENTLYSTOLEN_MAX ) {
|
if ( this.recentlyStolenGroup.total >= RECENTLYSTOLEN_MAX ) {
|
||||||
this.recentlyStolenGroup.remove(
|
this.recentlyStolenGroup.remove(
|
||||||
|
|||||||
Reference in New Issue
Block a user