Refactor away from '== null' checks towards isSet

This commit is contained in:
2014-06-26 07:15:38 -07:00
parent e0f236c5c0
commit 5ac3159e38
4 changed files with 29 additions and 28 deletions

View File

@@ -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) {