mirror of
https://github.com/bitburner-official/bitburner-src.git
synced 2026-05-04 06:37:49 +02:00
API: Cancel sleeve's current task when calling ns.sleeve.travel() (#2559)
This commit is contained in:
@@ -537,6 +537,14 @@ export class Sleeve extends Person implements SleevePerson {
|
||||
return false;
|
||||
}
|
||||
|
||||
travel(cityName: CityName): boolean {
|
||||
if (!super.travel(cityName)) {
|
||||
return false;
|
||||
}
|
||||
this.stopWork();
|
||||
return true;
|
||||
}
|
||||
|
||||
travelCostMoneySource(): MoneySource {
|
||||
return "sleeves";
|
||||
}
|
||||
|
||||
@@ -22,7 +22,6 @@ export function TravelModal(props: TravelModalProps): React.ReactElement {
|
||||
dialogBoxCreate("You cannot afford to have this sleeve travel to another city");
|
||||
return;
|
||||
}
|
||||
props.sleeve.stopWork();
|
||||
props.rerender();
|
||||
props.onClose();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user