diff --git a/src/PersonObjects/Sleeve/Sleeve.ts b/src/PersonObjects/Sleeve/Sleeve.ts index b81279ec6..90beb390f 100644 --- a/src/PersonObjects/Sleeve/Sleeve.ts +++ b/src/PersonObjects/Sleeve/Sleeve.ts @@ -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"; } diff --git a/src/PersonObjects/Sleeve/ui/TravelModal.tsx b/src/PersonObjects/Sleeve/ui/TravelModal.tsx index 11050000c..e4baf7820 100644 --- a/src/PersonObjects/Sleeve/ui/TravelModal.tsx +++ b/src/PersonObjects/Sleeve/ui/TravelModal.tsx @@ -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(); } diff --git a/src/utils/APIBreaks/3.0.0.ts b/src/utils/APIBreaks/3.0.0.ts index ae6a53823..239bcbbc6 100644 --- a/src/utils/APIBreaks/3.0.0.ts +++ b/src/utils/APIBreaks/3.0.0.ts @@ -570,5 +570,10 @@ export const breakingChanges300: VersionBreakingChange = { "RAM cost. Now the hacknet namespace does not incur RAM cost, but each hacknet API incurs a 0.5GB RAM cost.", showWarning: false, }, + { + brokenAPIs: [{ name: "ns.sleeve.travel" }], + info: "ns.sleeve.travel() did not cancel the sleeve's current task. It does now.", + showWarning: false, + }, ], }; diff --git a/src/utils/SaveDataMigrationUtils.ts b/src/utils/SaveDataMigrationUtils.ts index 64e081365..92ba77340 100644 --- a/src/utils/SaveDataMigrationUtils.ts +++ b/src/utils/SaveDataMigrationUtils.ts @@ -621,7 +621,7 @@ Error: ${e}`, if (ver < 45) { initDarkwebServer(); } - if (ver < 46) { + if (ver < 47) { showAPIBreaks("3.0.0", breakingChanges300); } }