返回提交历史
Modified
src/services/worldStateService.ts
+2
-8
XFEstudio/SpaceNinjaServer
fix: sortie rng desync (#4187)
idk if I hallucinated the difficulty or whatever, but it seems to not actually be generated by the client causing us to desync. The GasCity, Forest, and Settlement tilesets all have 2 textures so excluding these was definitely erroneous. Closes #4184 Reviewed-on: https://onlyg.it/OpenWF/SpaceNinjaServer/pulls/4187 Co-authored-by: Sainan <63328889+Sainan@users.noreply.github.com> Co-committed-by: Sainan <63328889+Sainan@users.noreply.github.com>
a3f0fd5a
代码差异
1 个文件
+2
-8
@@ -603,6 +603,7 @@ const pushTilesetModifiers = (modifiers: string[], tileset: TSortieTileset): voi
603
603
};
604
604
605
605
export const getSortie = (day: number, buildLabel: string): ISortie => {
606
// Seeds featuring CorpusIcePlanet to test seed validation: 23418, 71281
606
607
const seed = new SRng(day).randomInt(0, 100_000);
607
608
//logger.debug(`sortie seed: ${seed}`);
608
609
const rng = new SRng(seed);
@@ -769,15 +770,8 @@ const validateSortieSeed = (seed: number, variants: ISortieMission[]): boolean =
769
770
if (missionPermutation.extraEnemySpecs?.length) {
770
771
rng.randomInt(1, missionPermutation.extraEnemySpecs.length);
771
772
}
772
rng.randomFloat(); // difficulty
773
773
}
774
if (
775
variant.missionType != "MT_ARENA" &&
776
variant.missionType != "MT_JUNCTION" &&
777
variant.tileset.indexOf("GasCity") == -1 &&
778
variant.tileset.indexOf("Forest") == -1 &&
779
variant.tileset.indexOf("Settlement") == -1
780
) {
774
if (variant.missionType != "MT_ARENA" && variant.missionType != "MT_JUNCTION") {
781
775
const locationTextureIndex = rng.randomInt(0, 1);
782
776
if (variant.tileset == "CorpusIcePlanetTileset" || variant.tileset == "CorpusIcePlanetTilesetCaves") {
783
777
if (locationTextureIndex != 0) {