Merge pull request #3797 from Ansopedian/dev

BUGFIX: Singularity.goToLocation support for non-city-specific locations
This commit is contained in:
hydroflame 2022-07-21 02:14:42 -04:00 committed by GitHub
commit a513a842e3
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -271,11 +271,17 @@ export function NetscriptSingularity(player: IPlayer, workerScript: WorkerScript
_ctx.log(() => `No location named ${locationName}`);
return false;
}
if (player.city !== location.city) {
if (location.city && player.city !== location.city) {
_ctx.log(() => `No location named ${locationName} in ${player.city}`);
return false;
}
Router.toLocation(location);
if (location.name === LocationName.TravelAgency) {
Router.toTravel();
} else if (location.name === LocationName.WorldStockExchange) {
Router.toStockMarket();
} else {
Router.toLocation(location);
}
player.gainIntelligenceExp(CONSTANTS.IntelligenceSingFnBaseExpGain / 50000);
return true;
},