Skip to content

Commit

Permalink
Fix mexes.
Browse files Browse the repository at this point in the history
  • Loading branch information
GoogleFrog committed Oct 10, 2021
1 parent c2e916c commit b538b48
Showing 1 changed file with 9 additions and 7 deletions.
16 changes: 9 additions & 7 deletions luarules/gadgets/map_terrain_generator.lua
Original file line number Diff line number Diff line change
Expand Up @@ -2126,7 +2126,7 @@ local function SetEdgePassability(params, edge, minLandTier)
local otherEdge = nbhd[i]
if otherEdge.tierDiff ~= 0 and otherEdge.highTier == edge.highTier then
matchCount = matchCount + 1
if not otherEdge.botPass then
if otherEdge.terrainWidth and not otherEdge.vehPass then
impassCount = impassCount + 1
end
end
Expand Down Expand Up @@ -2197,19 +2197,19 @@ local function SetEdgePassability(params, edge, minLandTier)
end
end

-- Scale to edge height
edge.terrainWidth = edge.terrainWidth*edge.tierDiff

if (edge.terrainWidth*params.vehPassTiers/edge.tierDiff <= params.steepCliffWidth) then
if (edge.terrainWidth <= params.steepCliffWidth) then
edge.vehPass = false
edge.botPass = false
elseif (edge.terrainWidth*params.vehPassTiers/edge.tierDiff >= params.rampWidth) then
elseif (edge.terrainWidth*params.vehPassTiers >= params.rampWidth) then
edge.vehPass = true
edge.botPass = true
else
edge.vehPass = false
edge.botPass = true
end

-- Scale to edge height
edge.terrainWidth = edge.terrainWidth*edge.tierDiff
end

local function SetEdgeSoloTerrain(params, edge, waveFunc, waveHeightMult, tierFunc)
Expand Down Expand Up @@ -2852,6 +2852,8 @@ local function AllocateMetalSpots(cells, edges, minLandTier, startCell, params)
", Mid: " .. floor(100*thisCell.closeDistFactor) ..
", Crow: " .. floor(100*thisCell.startDistFactor) ..
", Alloc: " .. floor(1000*(thisCell.mexAlloc or 0)) ..
", Bot Dist: " .. (minBotDist or "NO BOT") ..

" Can D: " .. canDouble)
end
end
Expand Down Expand Up @@ -3288,7 +3290,7 @@ end
local function MakeMap()
local params = GetSpaceIncreaseParams()
local randomSeed = GetSeed()
--randomSeed = 9762916
randomSeed = 4146299
math.randomseed(randomSeed)

Spring.SetGameRulesParam("typemap", "temperate2")
Expand Down

0 comments on commit b538b48

Please sign in to comment.