Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
10 changes: 10 additions & 0 deletions .emmyrc.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,13 @@
"duplicate-set-field"
],
"globals": [
"BAR",
"Utilities",
"Debug",
"Lava",
"GetModOptionsCopy",
"I18N",
"I18N_PATH",
"Turn",
"Move",
"Spin",
Expand All @@ -33,11 +40,13 @@
"SIG_WALK",
"UNITSCRIPT_DIR",
"widgetHandler",
"actionHandler",
"gadgetHandler",
"fontHandler",
"LUAUI_DIRNAME",
"socket",
"pairsByKeys",
"ipairs_reverse",
"SendToUnsynced",
"CallAsTeam",
"handler",
Expand Down Expand Up @@ -77,6 +86,7 @@
},
"workspace": {
"ignoreDir": [
"modules/i18n/i18nlib/spec",
".vscode",
".lux"
],
Expand Down
4 changes: 2 additions & 2 deletions common/configs/unit_restrictions_config.lua
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ for unitDefID, unitDef in pairs(UnitDefs) do
end
end

if (unitDef.minWaterDepth > 0 or unitDef.modCategories["ship"]) and not (unitDef.customParams.restrictions_exclusion and string.find(unitDef.customParams.restrictions_exclusion, "_nosea_")) then
if (unitDef.minWaterDepth > 0 or unitDef.modCategories.ship) and not (unitDef.customParams.restrictions_exclusion and string.find(unitDef.customParams.restrictions_exclusion, "_nosea_")) then
isWaterUnit[unitDefID] = true
end
end
Expand All @@ -36,7 +36,7 @@ local function shouldShowWaterUnits()
voidWater = mapinfo.voidwater
end

local lava = Spring.Lava
local lava = BAR.Lava
local isLava = lava and lava.isLavaMap

if voidWater or isLava then
Expand Down
20 changes: 10 additions & 10 deletions common/holidays.lua
Original file line number Diff line number Diff line change
Expand Up @@ -76,49 +76,49 @@ local EasterEventDates = GetEasterStartEnd()

local holidaysList = {
-- Static -----------------------------
["aprilfools"] = {
aprilfools = {
firstDay = { day = 1, month = 4 },
lastDay = { day = 7, month = 4 },
},
["aprilfools_specialDay"] = {
aprilfools_specialDay = {
firstDay = { day = 1, month = 4 },
lastDay = { day = 1, month = 4 },
},

["halloween"] = {
halloween = {
firstDay = { day = 17, month = 10 },
lastDay = { day = 31, month = 10 },
},
["halloween_specialDay"] = {
halloween_specialDay = {
firstDay = { day = 31, month = 10 },
lastDay = { day = 31, month = 10 },
},

["xmas"] = {
xmas = {
firstDay = { day = 12, month = 12 },
lastDay = { day = 31, month = 12 },
},
["xmas_specialDay"] = {
xmas_specialDay = {
firstDay = { day = 24, month = 12 },
lastDay = { day = 26, month = 12 },
},

-- We split these into two events because yes
["newyearbefore"] = {
newyearbefore = {
firstDay = { day = 31, month = 12 },
lastDay = { day = 31, month = 12 },
},
["newyearafter"] = {
newyearafter = {
firstDay = { day = 1, month = 1 },
lastDay = { day = 1, month = 1 },
},

-- Dynamic -----------------------------
["easter"] = {
easter = {
firstDay = { day = EasterEventDates.firstDay, month = EasterEventDates.firstMonth },
lastDay = { day = EasterEventDates.lastDay, month = EasterEventDates.lastMonth },
},
["easter_specialDay"] = {
easter_specialDay = {
firstDay = { day = EasterEventDates.easterDay, month = EasterEventDates.easterMonth },
lastDay = { day = EasterEventDates.easterDay, month = EasterEventDates.easterMonth },
},
Expand Down
2 changes: 1 addition & 1 deletion common/lib_startpoint_guesser.lua
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ function GuessOne(teamID, allyID, xmin, zmin, xmax, zmax, startPointTable)
-- guess based on metal spots within startbox --

-- check if mex list generation worked and retrieve if so
local resourceSpotFinder = (GG and GG["resource_spot_finder"]) or (WG and WG["resource_spot_finder"])
local resourceSpotFinder = (GG and GG.resource_spot_finder) or (WG and WG.resource_spot_finder)
local metalSpots = resourceSpotFinder and resourceSpotFinder.metalSpotsList or nil
if not metalSpots or #metalSpots == 0 then
return -1, -1
Expand Down
2 changes: 1 addition & 1 deletion common/springOverrides.lua
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ if Spring.GetModOptions then

-- Returns a copy of the modOptions table. Slower, but allows iterating over
-- the returned table using pairs/ipairs.
Spring.GetModOptionsCopy = function()
BAR.GetModOptionsCopy = function()
return table.copy(modOptions)
end
end
Expand Down
6 changes: 4 additions & 2 deletions common/testing/infologtest.lua
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

local maxErrors = 10

function skip()
local function skip()
-- TODO: re-enable. disabled 2025-10-01 in order to get CICD working
return true
end
Expand Down Expand Up @@ -48,9 +48,11 @@ local function infologTest()
return errors
end

function test()
local function test()
local errors = infologTest()
if #errors > 0 then
error(table.concat(errors, "\n"), 0)
end
end

return { skip = skip, test = test }
22 changes: 11 additions & 11 deletions common/testing/mocha_json_reporter.lua
Original file line number Diff line number Diff line change
Expand Up @@ -79,19 +79,19 @@ end

function MochaJSONReporter:report(filePath)
local output = {
["stats"] = {
["suites"] = 1,
["tests"] = self.totalTests,
["passes"] = self.totalPasses,
["pending"] = 0,
["skipped"] = self.totalSkipped,
["failures"] = self.totalFailures,
["start"] = formatTimestamp(self.startTime),
stats = {
suites = 1,
tests = self.totalTests,
passes = self.totalPasses,
pending = 0,
skipped = self.totalSkipped,
failures = self.totalFailures,
start = formatTimestamp(self.startTime),
["end"] = formatTimestamp(self.endTime),
["duration"] = self.duration,
duration = self.duration,
},
["tests"] = self.tests,
["pending"] = self.skipped,
tests = self.tests,
pending = self.skipped,
}

local encoded = Json.encode(output)
Expand Down
24 changes: 12 additions & 12 deletions common/upgets/api_resource_spot_finder.lua
Original file line number Diff line number Diff line change
Expand Up @@ -30,11 +30,11 @@ local precision = Game.footprintScale * Game.squareSize -- (footprint 1 = 16 map

-- Some of these maps have more than 2 metal spots, disable mex denier
local metalMaps = {
["Oort_Cloud_V2"] = true,
Oort_Cloud_V2 = true,
["Asteroid_Mines_V2.1"] = true,
["Cloud9_V2"] = true,
["Iron_Isle_V1"] = true,
["Nine_Metal_Islands_V1"] = true,
Cloud9_V2 = true,
Iron_Isle_V1 = true,
Nine_Metal_Islands_V1 = true,
["SpeedMetal BAR V2"] = true,
}
local isMetalMap = false
Expand Down Expand Up @@ -380,14 +380,14 @@ function upget:Initialize()
end

geoSpots = GetSpotsGeo()
globalScope["resource_spot_finder"] = {}
globalScope["resource_spot_finder"].metalSpotsList = metalSpots
globalScope["resource_spot_finder"].geoSpotsList = geoSpots
globalScope["resource_spot_finder"].isMetalMap = isMetalMap
globalScope["resource_spot_finder"].GetClosestMexSpot = getClosestMex
globalScope["resource_spot_finder"].GetClosestGeoSpot = getClosestGeo
globalScope["resource_spot_finder"].GetBuildingPositions = GetBuildingPositions
globalScope["resource_spot_finder"].IsMexPositionValid = IsBuildingPositionValid
globalScope.resource_spot_finder = {}
globalScope.resource_spot_finder.metalSpotsList = metalSpots
globalScope.resource_spot_finder.geoSpotsList = geoSpots
globalScope.resource_spot_finder.isMetalMap = isMetalMap
globalScope.resource_spot_finder.GetClosestMexSpot = getClosestMex
globalScope.resource_spot_finder.GetClosestGeoSpot = getClosestGeo
globalScope.resource_spot_finder.GetBuildingPositions = GetBuildingPositions
globalScope.resource_spot_finder.IsMexPositionValid = IsBuildingPositionValid

if gadget then
setMexGameRules(metalSpots)
Expand Down
2 changes: 1 addition & 1 deletion effects/antinuke.lua
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
-- burngreen

return {
["antinuke"] = {
antinuke = {
explosion = {
air = true,
class = [[CSimpleParticleSystem]],
Expand Down
Loading
Loading