Skip to content

Commit bb9c457

Browse files
authored
admin: fix "No map selected" error dialog from appearing incorrectly (#665)
1 parent 4f84555 commit bb9c457

File tree

1 file changed

+7
-6
lines changed

1 file changed

+7
-6
lines changed

[admin]/admin/client/gui/admin_maps.lua

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -65,14 +65,15 @@ function guiClick(button)
6565
if source == aTabMap.RefreshList then
6666
guiGridListClear(aTabMap.MapList)
6767
triggerServerEvent("getMaps_s", localPlayer, true)
68+
return
6869
end
69-
if ( source ~= aTabMap.MapListSearch ) and guiGridListGetSelectedItem ( aTabMap.MapList ) == -1 then
70+
local selectedRow = guiGridListGetSelectedItem( aTabMap.MapList )
71+
local mapName = guiGridListGetItemText ( aTabMap.MapList, selectedRow, 1 )
72+
local mapResName = guiGridListGetItemText ( aTabMap.MapList, selectedRow, 2 )
73+
local gamemode = guiGridListGetItemText ( aTabMap.MapList, selectedRow, 3 )
74+
if ( source == aTabMap.Start or source == aTabMap.NextMap ) and selectedRow == -1 then
7075
aMessageBox ( "error", "No map selected!" )
71-
end
72-
local mapName = guiGridListGetItemText ( aTabMap.MapList, guiGridListGetSelectedItem( aTabMap.MapList ), 1 )
73-
local mapResName = guiGridListGetItemText ( aTabMap.MapList, guiGridListGetSelectedItem( aTabMap.MapList ), 2 )
74-
local gamemode = guiGridListGetItemText ( aTabMap.MapList, guiGridListGetSelectedItem( aTabMap.MapList ), 3 )
75-
if source == aTabMap.MapList then
76+
elseif source == aTabMap.MapList then
7677
if gamemode == "race" then
7778
guiSetEnabled(aTabMap.NextMap, true)
7879
else

0 commit comments

Comments
 (0)