From 102584e24bedccbc9fcf41381fd40be0c769dbb0 Mon Sep 17 00:00:00 2001 From: Dev Date: Sat, 8 Apr 2023 22:17:04 +0100 Subject: [PATCH] Workaround for bad shotgun dispersion values --- project/src/controllers/GameController.ts | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/project/src/controllers/GameController.ts b/project/src/controllers/GameController.ts index c7780939..c99e1e65 100644 --- a/project/src/controllers/GameController.ts +++ b/project/src/controllers/GameController.ts @@ -64,6 +64,8 @@ export class GameController // Store start time in app context this.applicationContext.addValue(ContextVariableType.CLIENT_START_TIMESTAMP, startTimeStampMS); + this.fixShotgunDispersions(); + this.openZoneService.applyZoneChangesToAllMaps(); this.customLocationWaveService.applyWaveChangesToAllMaps(); @@ -141,6 +143,26 @@ export class GameController } } + /** + * BSG have two values for shotgun dispersion, we make sure both have the same value + */ + protected fixShotgunDispersions(): void + { + const itemDb = this.databaseServer.getTables().templates.items; + + // Saiga 12ga + // Toz 106 + // Remington 870 + const shotguns = ["576165642459773c7a400233", "5a38e6bac4a2826c6e06d79b", "5a7828548dc32e5a9c28b516"]; + for (const shotgunId of shotguns) + { + if (itemDb[shotgunId]._props.ShotgunDispersion) + { + itemDb[shotgunId]._props.shotgunDispersion = itemDb[shotgunId]._props.ShotgunDispersion; + } + } + } + /** * Players set botReload to a high value and don't expect the crazy fast reload speeds, give them a warn about it * @param pmcProfile Player profile