File tree 1 file changed +3
-3
lines changed
1 file changed +3
-3
lines changed Original file line number Diff line number Diff line change @@ -188,7 +188,7 @@ export class JobService extends MongooseRepository<Job> {
188
188
const fleet = await this . fleetService . find ( job . fleet ) ;
189
189
const ships = await this . shipService . findAll ( { fleet : new Types . ObjectId ( job . fleet ) } ) ;
190
190
const systems = await this . systemService . findAll ( { _id : { $in : job . path } } ) ;
191
- if ( ! fleet || ! ships ) {
191
+ if ( ! fleet || ! ships . length ) {
192
192
continue ;
193
193
}
194
194
const slowestShipSpeed = this . systemLogicService . getSlowestShipSpeed ( fleet , ships , empire ) ;
@@ -197,11 +197,11 @@ export class JobService extends MongooseRepository<Job> {
197
197
for ( let i = 1 ; i < job . path . length ; i ++ ) {
198
198
const fromSystem = systems . find ( system => system . _id . equals ( job . path ! [ i - 1 ] ) ) ;
199
199
const toSystem = systems . find ( system => system . _id . equals ( job . path ! [ i ] ) ) ;
200
-
201
200
if ( ! fromSystem || ! toSystem ) {
202
201
continue ;
203
202
}
204
- linkTimeSum += Math . round ( this . systemLogicService . getLinkTime ( fromSystem , toSystem , slowestShipSpeed ) ! ) ;
203
+
204
+ linkTimeSum += this . systemLogicService . getLinkTime ( fromSystem , toSystem , slowestShipSpeed ) ! ;
205
205
206
206
if ( job . progress + 1 >= linkTimeSum ) {
207
207
fleet . location = toSystem . _id ;
You can’t perform that action at this time.
0 commit comments