File tree 1 file changed +6
-2
lines changed
1 file changed +6
-2
lines changed Original file line number Diff line number Diff line change @@ -108,17 +108,21 @@ module.exports = {
108
108
let time = 0 ;
109
109
const terrain = creepToCalculate . room . getTerrain ( ) ;
110
110
for ( let each in creepToCalculate . pos . findPathTo ( creepToCalculate . pos . findClosestByPath ( FIND_MY_SPAWNS ) ) ) {
111
+ // noinspection JSUnfilteredForInLoop
111
112
if ( creepToCalculate . room . getPositionAt ( each . x , each . y ) . lookFor ( LOOK_STRUCTURES ) [ 0 ] . structureType === STRUCTURE_ROAD ) {
112
113
time += ( weight * 1 ) - ( movement * 2 ) ;
113
114
}
114
115
else {
116
+ // noinspection JSUnfilteredForInLoop
115
117
switch ( terrain . get ( each . x , each . y ) ) {
116
- case TERRAIN_MASK_WALL :
117
- return - 1 ;
118
118
case TERRAIN_MASK_SWAMP :
119
119
time += ( weight * 10 ) - ( movement * 2 ) ;
120
+ break ;
120
121
case 0 :
121
122
time += ( weight * 2 ) - ( movement * 2 ) ;
123
+ break ;
124
+ default :
125
+ return - 1 ;
122
126
}
123
127
}
124
128
}
You can’t perform that action at this time.
0 commit comments