Skip to content

Commit

Permalink
resource -> mapResource to avoid confusion
Browse files Browse the repository at this point in the history
  • Loading branch information
jlillis committed Jul 18, 2024
1 parent d42a4b2 commit c598e6f
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions [gamemodes]/[deathmatch]/deathmatch/server/main.lua
Original file line number Diff line number Diff line change
Expand Up @@ -37,10 +37,10 @@ addEventHandler("onGamemodeStop", resourceRoot, stopGamemode)
--
-- startGamemodeMap: initializes a gamemode map
--
local function startGamemodeMap(resource)
local function startGamemodeMap(mapResource)
-- load map settings
_mapResource = resource
local resourceName = getResourceName(resource)
_mapResource = mapResource
local resourceName = getResourceName(mapResource)
_fragLimit = tonumber(get(resourceName..".frag_limit")) and math.floor(tonumber(get(resourceName..".frag_limit"))) or defaults.fragLimit
_timeLimit = (tonumber(get(resourceName..".time_limit")) and math.floor(tonumber(get(resourceName..".time_limit"))) or defaults.timeLimit)*1000
_respawnTime = (tonumber(get(resourceName..".respawn_time")) and math.floor(tonumber(get(resourceName..".respawn_time"))) or defaults.respawnTime)*1000
Expand All @@ -60,11 +60,11 @@ local function startGamemodeMap(resource)
end
end
-- if the map title is not defined in the map's meta.xml, use the resource name
_mapTitle = getResourceInfo(resource, "name")
_mapTitle = getResourceInfo(mapResource, "name")
if not _mapTitle then
_mapTitle = resourceName
end
_mapAuthor = getResourceInfo(resource, "author")
_mapAuthor = getResourceInfo(mapResource, "author")
-- update game state
setElementData(resourceRoot, "gameState", GAME_STARTING)
-- inform all ready players that the game is about to start
Expand All @@ -81,7 +81,7 @@ addEventHandler("onGamemodeMapStart", root, startGamemodeMap)
--
-- stopGamemodeMap: cleans up a gamemode map
--
local function stopGamemodeMap(resource)
local function stopGamemodeMap(mapResource)
-- end the round
endRound(false, false, true)
-- update game state
Expand Down

0 comments on commit c598e6f

Please sign in to comment.