@@ -194,7 +194,8 @@ exports.make = function(_runtimeData, _intents, _register, _globals) {
194194 if ( ! this . room . controller ) {
195195 return false ;
196196 }
197- return utils . checkStructureAgainstController ( data ( this . id ) , register . objectsByRoom [ data ( this . id ) . room ] , data ( this . room . controller . id ) ) ;
197+
198+ return ! data ( this . id ) . off
198199 } ) ;
199200
200201 Object . defineProperty ( globals , 'Structure' , { enumerable : true , value : Structure } ) ;
@@ -434,7 +435,7 @@ exports.make = function(_runtimeData, _intents, _register, _globals) {
434435 if ( this . cooldown > 0 ) {
435436 return C . ERR_TIRED ;
436437 }
437- if ( ! utils . checkStructureAgainstController ( data ( this . id ) , register . objectsByRoom [ data ( this . id ) . room ] , data ( this . room . controller . id ) ) ) {
438+ if ( data ( this . id ) . off ) {
438439 return C . ERR_RCL_NOT_ENOUGH ;
439440 }
440441 if ( ! lab1 || ! lab1 . id || ! register . structures [ lab1 . id ] ||
@@ -469,7 +470,7 @@ exports.make = function(_runtimeData, _intents, _register, _globals) {
469470 if ( ! this . my ) {
470471 return C . ERR_NOT_OWNER ;
471472 }
472- if ( ! utils . checkStructureAgainstController ( data ( this . id ) , register . objectsByRoom [ data ( this . id ) . room ] , data ( this . room . controller . id ) ) ) {
473+ if ( data ( this . id ) . off ) {
473474 return C . ERR_RCL_NOT_ENOUGH ;
474475 }
475476 if ( ! target || ! target . id || ! register . creeps [ target . id ] || ! ( target instanceof globals . Creep ) || target . spawning ) {
@@ -504,7 +505,7 @@ exports.make = function(_runtimeData, _intents, _register, _globals) {
504505 if ( ! this . my || ! target . my ) {
505506 return C . ERR_NOT_OWNER ;
506507 }
507- if ( ! utils . checkStructureAgainstController ( data ( this . id ) , register . objectsByRoom [ data ( this . id ) . room ] , data ( this . room . controller . id ) ) ) {
508+ if ( data ( this . id ) . off ) {
508509 return C . ERR_RCL_NOT_ENOUGH ;
509510 }
510511 if ( this . cooldown > 0 ) {
@@ -568,7 +569,7 @@ exports.make = function(_runtimeData, _intents, _register, _globals) {
568569 if ( ! this . room . controller ) {
569570 return C . ERR_RCL_NOT_ENOUGH ;
570571 }
571- if ( ! utils . checkStructureAgainstController ( data ( this . id ) , register . objectsByRoom [ data ( this . id ) . room ] , data ( this . room . controller . id ) ) ) {
572+ if ( data ( this . id ) . off ) {
572573 return C . ERR_RCL_NOT_ENOUGH ;
573574 }
574575 }
@@ -628,7 +629,7 @@ exports.make = function(_runtimeData, _intents, _register, _globals) {
628629 if ( ! _ . isString ( roomName ) || ! / ^ ( W | E ) \d + ( S | N ) \d + $ / . test ( roomName ) ) {
629630 return C . ERR_INVALID_ARGS ;
630631 }
631- if ( ! utils . checkStructureAgainstController ( data ( this . id ) , register . objectsByRoom [ data ( this . id ) . room ] , data ( this . room . controller . id ) ) ) {
632+ if ( data ( this . id ) . off ) {
632633 return C . ERR_RCL_NOT_ENOUGH ;
633634 }
634635
@@ -689,7 +690,7 @@ exports.make = function(_runtimeData, _intents, _register, _globals) {
689690 if ( ! this . my ) {
690691 return C . ERR_NOT_OWNER ;
691692 }
692- if ( ! utils . checkStructureAgainstController ( data ( this . id ) , register . objectsByRoom [ data ( this . id ) . room ] , data ( this . room . controller . id ) ) ) {
693+ if ( data ( this . id ) . off ) {
693694 return C . ERR_RCL_NOT_ENOUGH ;
694695 }
695696 if ( ! this . power || this . energy < C . POWER_SPAWN_ENERGY_RATIO ) {
@@ -789,7 +790,7 @@ exports.make = function(_runtimeData, _intents, _register, _globals) {
789790 if ( ! this . my ) {
790791 return C . ERR_NOT_OWNER ;
791792 }
792- if ( ! utils . checkStructureAgainstController ( data ( this . id ) , register . objectsByRoom [ data ( this . id ) . room ] , data ( this . room . controller . id ) ) ) {
793+ if ( data ( this . id ) . off ) {
793794 return C . ERR_RCL_NOT_ENOUGH ;
794795 }
795796 if ( ! / ^ ( W | E ) \d + ( N | S ) \d + $ / . test ( targetRoomName ) ) {
@@ -853,7 +854,7 @@ exports.make = function(_runtimeData, _intents, _register, _globals) {
853854 if ( data ( this . id ) . energy < C . TOWER_ENERGY_COST ) {
854855 return C . ERR_NOT_ENOUGH_ENERGY ;
855856 }
856- if ( ! utils . checkStructureAgainstController ( data ( this . id ) , register . objectsByRoom [ data ( this . id ) . room ] , data ( this . room . controller . id ) ) ) {
857+ if ( data ( this . id ) . off ) {
857858 return C . ERR_RCL_NOT_ENOUGH ;
858859 }
859860
@@ -872,7 +873,7 @@ exports.make = function(_runtimeData, _intents, _register, _globals) {
872873 if ( data ( this . id ) . energy < C . TOWER_ENERGY_COST ) {
873874 return C . ERR_NOT_ENOUGH_ENERGY ;
874875 }
875- if ( ! utils . checkStructureAgainstController ( data ( this . id ) , register . objectsByRoom [ data ( this . id ) . room ] , data ( this . room . controller . id ) ) ) {
876+ if ( data ( this . id ) . off ) {
876877 return C . ERR_RCL_NOT_ENOUGH ;
877878 }
878879
@@ -892,7 +893,7 @@ exports.make = function(_runtimeData, _intents, _register, _globals) {
892893 if ( data ( this . id ) . energy < C . TOWER_ENERGY_COST ) {
893894 return C . ERR_NOT_ENOUGH_ENERGY ;
894895 }
895- if ( ! utils . checkStructureAgainstController ( data ( this . id ) , register . objectsByRoom [ data ( this . id ) . room ] , data ( this . room . controller . id ) ) ) {
896+ if ( data ( this . id ) . off ) {
896897 return C . ERR_RCL_NOT_ENOUGH ;
897898 }
898899
@@ -1461,7 +1462,7 @@ exports.make = function(_runtimeData, _intents, _register, _globals) {
14611462 if ( this . cooldown > 0 ) {
14621463 return C . ERR_TIRED ;
14631464 }
1464- if ( ! utils . checkStructureAgainstController ( data ( this . id ) , register . objectsByRoom [ data ( this . id ) . room ] , data ( this . room . controller . id ) ) ) {
1465+ if ( data ( this . id ) . off ) {
14651466 return C . ERR_RCL_NOT_ENOUGH ;
14661467 }
14671468 var [ tx , ty ] = utils . roomNameToXY ( pos . roomName ) ;
0 commit comments