Skip to content

Commit b7df05f

Browse files
committed
Added missing MinimumCSPVersion check
1 parent 6ce86ad commit b7df05f

2 files changed

Lines changed: 7 additions & 6 deletions

File tree

FastTravelPlugin/FastTravelPlugin.cs

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -23,14 +23,13 @@ public FastTravelPlugin(FastTravelConfiguration configuration,
2323
{
2424
_aiSpline = aiSpline ?? throw new ConfigurationException("FastTravelPlugin does not work with AI traffic disabled");
2525

26-
if (configuration.DisableCollisions && serverConfiguration.CSPTrackOptions.MinimumCSPVersion < CSPVersion.V0_2_8)
27-
{
28-
throw new ConfigurationException("FastTravelPlugin needs a minimum required CSP version of 0.2.8 (3424)");
29-
}
26+
var requiredVersion = configuration.DisableCollisions ? CSPVersion.V0_2_8 : CSPVersion.V0_2_0;
27+
var requiredVersionString = configuration.DisableCollisions ? "0.2.8 (3424)" : "0.2.0 (2651)";
28+
var minimumVersion = serverConfiguration.CSPTrackOptions.MinimumCSPVersion ?? throw new ConfigurationException($"FastTravelPlugin needs a minimum required CSP version of {requiredVersionString}");
3029

31-
if (!configuration.DisableCollisions && serverConfiguration.CSPTrackOptions.MinimumCSPVersion < CSPVersion.V0_2_0)
30+
if (minimumVersion < requiredVersion)
3231
{
33-
throw new ConfigurationException("FastTravelPlugin needs a minimum required CSP version of 0.2.0 (2651)");
32+
throw new ConfigurationException($"FastTravelPlugin needs a minimum required CSP version of {requiredVersionString}");
3433
}
3534

3635
if (!serverConfiguration.Extra.EnableClientMessages)

FastTravelPlugin/lua/fasttravel.lua

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -331,6 +331,7 @@ local function window_FastTravelDebug()
331331
if ui.checkbox("Use Group Draw Mode", debugUseGroupDrawMode) then
332332
debugUseGroupDrawMode = not debugUseGroupDrawMode
333333
config.useGroupDrawMode = debugUseGroupDrawMode
334+
getTeleports()
334335
end
335336

336337
if not debugUseGroupDrawMode then
@@ -346,6 +347,7 @@ local function window_FastTravelDebug()
346347
debugHideUntypedPoints, config.hideUntypedPoints = debugOrigHideUntypedPoints, debugOrigHideUntypedPoints
347348
debugUseGroupDrawMode, config.useGroupDrawMode = debugOrigUseGroupDrawMode, debugOrigUseGroupDrawMode
348349
debugDistanceModeRange, config.distanceModeRange = debugOrigDistanceModeRange, debugOrigDistanceModeRange
350+
getTeleports()
349351
end
350352
end)
351353

0 commit comments

Comments
 (0)