@@ -5,27 +5,33 @@ mapsettings.gamemodeSettings = {}
5
5
local valueWidget
6
6
local isHandled
7
7
addEventHandler ( " doLoadEDF" , root ,
8
- function (tableEDF , resource )
8
+ function (tableEDF , resource , isMapLoading )
9
9
-- store all our data neatly under the resource
10
10
edfSettings [resource ] = tableEDF [" settings" ]
11
11
refreshGamemodeSettings ()
12
12
-- send back the intepreted gui table so the server knows the settings !!Lazy, server could interpret this info or only one client could send it
13
- mapsettings .gamemodeSettings = copyTable ( mapsettings .rowValues )
14
- currentMapSettings .rowData = rowData
15
- currentMapSettings .gamemodeSettings = mapsettings .gamemodeSettings
16
- triggerServerEvent ( " doSaveMapSettings" , localPlayer , currentMapSettings , true )
13
+ -- prevent edf from overwriting map settings while the map is being loaded
14
+ if not isMapLoading then
15
+ mapsettings .gamemodeSettings = copyTable ( mapsettings .rowValues )
16
+ currentMapSettings .rowData = rowData
17
+ currentMapSettings .gamemodeSettings = mapsettings .gamemodeSettings
18
+ triggerServerEvent ( " doSaveMapSettings" , localPlayer , currentMapSettings , true )
19
+ end
17
20
end )
18
21
19
22
addEventHandler ( " doUnloadEDF" , root ,
20
- function (resource )
23
+ function (resource , isMapLoading )
21
24
-- store all our data neatly under the resource
22
25
edfSettings [resource ] = nil
23
26
refreshGamemodeSettings ()
24
27
-- send back the intepreted gui table so the server knows the settings !!Lazy, server could interpret this info or only one client could send it
25
- mapsettings .gamemodeSettings = copyTable ( mapsettings .rowValues )
26
- currentMapSettings .rowData = rowData
27
- currentMapSettings .gamemodeSettings = mapsettings .gamemodeSettings
28
- triggerServerEvent ( " doSaveMapSettings" , localPlayer , currentMapSettings , true )
28
+ -- prevent edf from overwriting map settings while the map is being loaded
29
+ if not isMapLoading then
30
+ mapsettings .gamemodeSettings = copyTable ( mapsettings .rowValues )
31
+ currentMapSettings .rowData = rowData
32
+ currentMapSettings .gamemodeSettings = mapsettings .gamemodeSettings
33
+ triggerServerEvent ( " doSaveMapSettings" , localPlayer , currentMapSettings , true )
34
+ end
29
35
end )
30
36
31
37
function refreshGamemodeSettings ()
0 commit comments