Skip to content

Commit

Permalink
fix stuff
Browse files Browse the repository at this point in the history
  • Loading branch information
EvaisaDev committed Jul 1, 2024
1 parent 4b66dab commit 79ce679
Show file tree
Hide file tree
Showing 3 changed files with 35 additions and 29 deletions.
28 changes: 15 additions & 13 deletions evaisa.mp/files/scripts/lobby_handler.lua
Original file line number Diff line number Diff line change
Expand Up @@ -405,19 +405,21 @@ function ModData()
local file2, err = io.open(infoFile, 'rb')
if file2 then
local content2 = file2:read("*all")
local parsedModInfo = nxml.parse(content2)

local download_link = parsedModInfo.attr.download_link

if (elem.attr.enabled == "1") then
table.insert(data,
{
workshop_item_id = steamID,
id = modID,
name = parsedModInfo.attr.name,
description = parsedModInfo.attr.description,
download_link = download_link,
})
if(content2 ~= nil and content2 ~= "")then
local parsedModInfo = nxml.parse(content2)

local download_link = parsedModInfo.attr.download_link

if (elem.attr.enabled == "1") then
table.insert(data,
{
workshop_item_id = steamID,
id = modID,
name = parsedModInfo.attr.name,
description = parsedModInfo.attr.description,
download_link = download_link,
})
end
end
end
end
Expand Down
34 changes: 19 additions & 15 deletions evaisa.mp/init.lua
Original file line number Diff line number Diff line change
Expand Up @@ -138,18 +138,20 @@ function GetGamemodeFilePath()
local file2, err = io.open(infoFile, 'rb')
if file2 then
local content2 = file2:read("*all")
local parsedModInfo = nxml.parse(content2)
if(content2 ~= nil and content2 ~= "")then
local parsedModInfo = nxml.parse(content2)

local is_game_mode = parsedModInfo.attr.is_game_mode == "1"
local is_game_mode = parsedModInfo.attr.is_game_mode == "1"

if (ModIsEnabled(modID) and is_game_mode) then
print("Found enabled gamemode: " .. modID)
if steamID == "0" then
file_path = "mods/" .. modID
else
file_path = "../../workshop/content/881100/" .. steamID
if (ModIsEnabled(modID) and is_game_mode) then
print("Found enabled gamemode: " .. modID)
if steamID == "0" then
file_path = "mods/" .. modID
else
file_path = "../../workshop/content/881100/" .. steamID
end
break
end
break
end
end

Expand Down Expand Up @@ -1560,14 +1562,16 @@ local fix_falsely_enabled_gamemodes = function()
local file2, err = io.open(infoFile, 'rb')
if file2 then
local content2 = file2:read("*all")
local parsedModInfo = nxml.parse(content2)
if(content2 ~= nil and content2 ~= "")then
local parsedModInfo = nxml.parse(content2)

local download_link = parsedModInfo.attr.download_link
local is_game_mode = parsedModInfo.attr.is_game_mode == "1"
local download_link = parsedModInfo.attr.download_link
local is_game_mode = parsedModInfo.attr.is_game_mode == "1"

if (elem.attr.enabled == "1" and is_game_mode) then
elem.attr.enabled = "0"
print("Disabling " .. modID)
if (elem.attr.enabled == "1" and is_game_mode) then
elem.attr.enabled = "0"
print("Disabling " .. modID)
end
end
end
end
Expand Down
2 changes: 1 addition & 1 deletion evaisa.mp/version.lua
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
MP_VERSION = 370
MP_VERSION = 371
MP_PRESET_VERSION = 2

0 comments on commit 79ce679

Please sign in to comment.