added singularity.goToLocation support for non-city-specific locations

This commit is contained in:
Ansopedian 2022-05-30 14:23:06 +02:00
parent 6f017bf4f6
commit d319b3f982

@ -244,11 +244,17 @@ export function NetscriptSingularity(player: IPlayer, workerScript: WorkerScript
_ctx.log(() => `No location named ${locationName}`); _ctx.log(() => `No location named ${locationName}`);
return false; return false;
} }
if (player.city !== location.city) { if (location.city && player.city !== location.city) {
_ctx.log(() => `No location named ${locationName} in ${player.city}`); _ctx.log(() => `No location named ${locationName} in ${player.city}`);
return false; 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); player.gainIntelligenceExp(CONSTANTS.IntelligenceSingFnBaseExpGain / 50000);
return true; return true;
}, },