Skip to content

Commit

Permalink
RANGE_* constants for creeps, structures and powercreeps
Browse files Browse the repository at this point in the history
clone and fixed merge conflicts of screeps/engine PR #6 by PostCrafter
added RANGE_* constants for PowerCreeps
  • Loading branch information
semperrabbit authored and RiftLurker committed Oct 27, 2020
1 parent 7f1fafc commit 40bee10
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/game/power-creeps.js
Original file line number Diff line number Diff line change
Expand Up @@ -305,7 +305,7 @@ exports.make = function(_runtimeData, _intents, _register, _globals) {
register.assertTargetObject(target);
return C.ERR_INVALID_TARGET;
}
if(!target.pos.isNearTo(this.pos)) {
if(!target.pos.inRangeTo(this.pos, C.RANGE_ENABLE_POWER)) {
return C.ERR_NOT_IN_RANGE;
}
if(target.structureType != 'controller' || target.safeMode && !target.my) {
Expand Down

0 comments on commit 40bee10

Please sign in to comment.