Fix editing or creating adverts in XGUI causing server errors

This commit is contained in:
SticklyMan 2024-03-09 18:34:23 -07:00
parent edc002d27c
commit e2514db207
3 changed files with 4 additions and 3 deletions

View File

@ -10,6 +10,7 @@
* [FIX] On listen servers, using the slider on some gmod server settings would cause the setting to constantly jump around.
* [FIX] XGUI: "Keep AI Ragdoll" setting replaced with "Keep Corpses", which should work now.
* [FIX] XGUI: Sandbox "Persist" setting now supports setting the persistence file name.
* [FIX] XGUI: Creating or editing adverts would cause server errors instead of showing the advert until mapchange.
* [FIX] XLIB: Alpha slider bar no longer saves decimal, no longer backwards while typing in a value.
* [CHANGE] Exposed ragdoll and unragdoll functions to the ulx table so they can be called externally. (Thanks, brandonsturgeon)
* [CHANGE] XGUI: Update sandbox limit definitions and slider maximums, removed deprecated limits.

View File

@ -107,7 +107,7 @@ function settings.init()
function settings.addAdvert( ply, args )
if ULib.ucl.query( ply, "xgui_svsettings" ) then
if args[3] == "<No Group>" then args[3] = nil end
local color = { r = tonumber( args[4] ), g = tonumber( args[5] ), b = tonumber( args[6] ), a = 255 } or nil
local color = Color( tonumber( args[4] ), tonumber( args[5] ), tonumber( args[6] ), 255 ) or nil
ulx.addAdvert( args[1], tonumber( args[2] ), args[3], color, tonumber( args[7] ) )
if args[8] ~= "hold" then
xgui.sendDataTable( {}, "adverts" )
@ -126,7 +126,7 @@ function settings.init()
local advert = ulx.adverts[group][number]
advert.message = args[4]
advert.rpt = tonumber( args[5] )
advert.color = { a=255, r=tonumber( args[6] ), g=tonumber( args[7] ), b=tonumber( args[8] ) }
advert.color = Color( tonumber( args[6] ), tonumber( args[7] ), tonumber( args[8] ), 255 )
advert.len = tonumber( args[9] )
xgui.sendDataTable( {}, "adverts" )
settings.saveAdverts()

View File

@ -1 +1 @@
1708628139
1710034463