XFE Git
XFE Studio Git
Git 首页 全局搜索
XFE 主站 文档 NuGet

SpaceNinjaServer

A simple server for a small space ninja game

公开
关注 0 Fork 1 Star 0
返回提交历史

XFEstudio/SpaceNinjaServer

chore: reject sortie seeds that result in infested hijack missions (#4434)

Closes #4433 Reviewed-on: https://onlyg.it/OpenWF/SpaceNinjaServer/pulls/4434 Co-authored-by: Sainan <63328889+Sainan@users.noreply.github.com> Co-committed-by: Sainan <63328889+Sainan@users.noreply.github.com>

f4df23d0
Sainan <63328889+Sainan@users.noreply.github.com>
提交于

代码差异

1 个文件 +13 -7
Modified src/services/worldStateService.ts +13 -7
@@ -779,6 +779,7 @@ const SORTIE_FALLBACK_MISSION_TYPES: TMissionType[] = [
779 779 const validateSortieSeed = (seed: number, enemyFaction: TFaction, variants: ISortieMission[]): boolean => {
780 780 const rng = new SRng(seed);
781 781 for (const variant of variants) {
782 // Gather variant data as the client would
782 783 let missionType = variant.missionType;
783 784 const tileset = ExportTilesets[variant.tileset];
784 785 if (missionType != "MT_ASSASSINATION") {
@@ -807,13 +808,18 @@ const validateSortieSeed = (seed: number, enemyFaction: TFaction, variants: ISor
807 808 rng.randomInt(0, 3);
808 809 }
809 810 }
810 if (missionType != "MT_ARENA" && missionType != "MT_JUNCTION") {
811 const locationTextureIndex = rng.randomInt(0, 1);
812 if (variant.tileset == "CorpusIcePlanetTileset" || variant.tileset == "CorpusIcePlanetTilesetCaves") {
813 if (locationTextureIndex != 0) {
814 return false; // For the corpus ice planet tileset, index 1 is an infested corpus ship image, which we don't want.
815 }
816 }
811 const locationTextureIndex =
812 missionType == "MT_ARENA" || missionType == "MT_JUNCTION" ? 0 : rng.randomInt(0, 1);
813
814 // Reject this seed if the data looks bad
815 if (missionType == "MT_RETRIEVAL" && enemyFaction == "FC_INFESTATION") {
816 return false;
817 }
818 if (
819 (variant.tileset == "CorpusIcePlanetTileset" || variant.tileset == "CorpusIcePlanetTilesetCaves") &&
820 locationTextureIndex != 0
821 ) {
822 return false; // For the corpus ice planet tileset, index 1 is an infested corpus ship image, which we don't want.
817 823 }
818 824 }
819 825 return true;