Refactor away from '== null' checks towards isSet
This commit is contained in:
@@ -281,7 +281,7 @@ GameState.prototype.update = function()
|
||||
if ( this.aiSprites.debug == true ) {
|
||||
function _draw_viewrect(x) {
|
||||
var r = x.viewRectangle();
|
||||
if ( r == null )
|
||||
if ( isSet(r) )
|
||||
return;
|
||||
this.shadowTexture.context.fillStyle = 'rgb(128, 128, 128)';
|
||||
this.shadowTexture.context.fillRect(r.left,
|
||||
@@ -292,7 +292,7 @@ GameState.prototype.update = function()
|
||||
this.aiSprites.forEach(_draw_viewrect, this);
|
||||
function _draw_aipath(x) {
|
||||
var p = x.path;
|
||||
if ( p == null )
|
||||
if ( isSet(p) )
|
||||
return;
|
||||
this.shadowTexture.context.fillStyle = 'rgb(255, 128, 128)';
|
||||
p.forEach(function(r) {
|
||||
|
||||
Reference in New Issue
Block a user