File tree 2 files changed +8
-2
lines changed
2 files changed +8
-2
lines changed Original file line number Diff line number Diff line change @@ -111,9 +111,13 @@ export class JobLogicService {
111
111
throw new BadRequestException ( 'Ship type and fleet id are required for this job type.' ) ;
112
112
}
113
113
const ship = SHIP_TYPES [ dto . ship as ShipTypeName ] ?? notFound ( dto . ship as ShipTypeName ) ;
114
+ const time = this . empireLogicService . getShipTime ( empire , ship ) ;
115
+ if ( ! time ) {
116
+ throw new BadRequestException ( 'This ship type is not unlocked yet (build_time=0).' ) ;
117
+ }
114
118
return {
115
119
...this . empireLogicService . getShipCost ( empire , ship ) ,
116
- time : this . empireLogicService . getShipTime ( empire , ship ) ,
120
+ time,
117
121
} ;
118
122
}
119
123
case JobType . TRAVEL : {
Original file line number Diff line number Diff line change @@ -98,7 +98,9 @@ export class Job extends GlobalSchema {
98
98
@Prop ( { type : String } )
99
99
@ApiPropertyOptional ( {
100
100
example : 'explorer' ,
101
- description : 'Ship type name for the job. Required for type=ship.' ,
101
+ description : 'Ship type name for the job. Required for type=ship.\n\n' +
102
+ 'Note that if the ship type build_time variable is 0 for this empire, the ship cannot be built.\n' +
103
+ 'In this case, a technology is required to unlock the ship type.' ,
102
104
enum : SHIP_NAMES ,
103
105
} )
104
106
@ValidateIf ( ( job , value ) => value || job . type === JobType . SHIP )
You can’t perform that action at this time.
0 commit comments