Skip to content

Commit

Permalink
Journey small fixes + thirst module fix for platforms
Browse files Browse the repository at this point in the history
  • Loading branch information
hanakocz committed Jan 5, 2025
1 parent 1fac93d commit 1da5548
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 6 deletions.
7 changes: 6 additions & 1 deletion maps/journey/functions.lua
Original file line number Diff line number Diff line change
Expand Up @@ -1444,7 +1444,12 @@ function Public.dispatch_goods(journey)

if journey.dispatch_beacon_position then
local good = goods_to_dispatch[journey.dispatch_key]
surface.spill_item_stack({ position = journey.dispatch_beacon_position, stack = { name = good[1], count = good[2] }, enable_looted = true, allow_belts = false })
local pod = surface.create_entity({name = 'cargo-pod-container', position = journey.dispatch_beacon_position, force = game.forces.player})
if pod and pod.valid then
pod.insert({name = good[1], count = good[2]})
else
surface.spill_item_stack({ position = journey.dispatch_beacon_position, stack = { name = good[1], count = good[2] }, enable_looted = true, allow_belts = false })
end
table.remove(journey.goods_to_dispatch, journey.dispatch_key)
journey.dispatch_beacon = nil
journey.dispatch_beacon_position = nil
Expand Down
12 changes: 9 additions & 3 deletions maps/journey/main.lua
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ local Global = require 'utils.global'
local Token = require 'utils.token'
local Event = require 'utils.event'
local Vacants = require 'modules.clear_vacant_players'
local Robolimits = require 'modules.robot_limits'

local journey = {
announce_capsules = true
Expand Down Expand Up @@ -189,9 +190,11 @@ local function on_rocket_launched(event)
rocket_inventory.clear()
rocket_inventory.insert({name = 'space-science-pack', count = 200})
local force = event.rocket.force
force.technologies['space-science-pack'].researched = true
force.print('[technology=space-science-pack] researched.')
force.play_sound({path = 'utility/research_completed'})
if force.technologies['space-science-pack'].researched == false then
force.technologies['space-science-pack'].researched = true
force.print('[technology=space-science-pack] researched.')
force.play_sound({path = 'utility/research_completed'})
end
Functions.draw_gui(journey)
end

Expand Down Expand Up @@ -251,6 +254,9 @@ local function on_init()

game.permissions.get_group('Default').set_allows_action(defines.input_action.set_rocket_silo_send_to_orbit_automated_mode, false)
Vacants.init(1, true)
Robolimits.set_construction_robot_limit(1000)
Robolimits.set_logistic_robot_limit(1000)
Robolimits.set_roboport_limit(100)
Functions.hard_reset(journey)
end

Expand Down
5 changes: 3 additions & 2 deletions modules/thirst.lua
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,8 @@ local this = {
gleba = 0.6,
vulcanus = 3,
aquilo = 0.8,
fulgora = 1.5
fulgora = 1.5,
platform = 0
}
}

Expand Down Expand Up @@ -69,7 +70,7 @@ local function update_hydration_meter(player)
end

local function local_modifier(surface)
local planet_name = surface.planet and surface.planet.name or 'custom'
local planet_name = (surface.platform and 'platform') or (surface.planet and surface.planet.name) or 'custom'
local modifier = this.planet_thirstiness[planet_name] or this.planet_thirstiness['custom']
return modifier
end
Expand Down

0 comments on commit 1da5548

Please sign in to comment.