From 4f189476e220fa4fd59ae63fd055a6b456428093 Mon Sep 17 00:00:00 2001 From: RedRafe Date: Fri, 20 Feb 2026 11:54:27 +0100 Subject: [PATCH 1/6] Address exploit of container dump module --- features/gui/experience.lua | 2 +- .../danger_ores/modules/container_dump.lua | 44 +++++++++++++++++++ 2 files changed, 45 insertions(+), 1 deletion(-) diff --git a/features/gui/experience.lua b/features/gui/experience.lua index 45dc2728b..2ef84935c 100644 --- a/features/gui/experience.lua +++ b/features/gui/experience.lua @@ -483,7 +483,7 @@ local function on_entity_died(event) -- stuff killed by the player force, but not the player if force and force.name == 'player' then - if cause and (cause.name == 'artillery-turret' or cause.name == 'gun-turret' or cause.name == 'laser-turret' or cause.name == 'flamethrower-turret') then + if cause and cause.valid and (cause.name == 'artillery-turret' or cause.name == 'gun-turret' or cause.name == 'laser-turret' or cause.name == 'flamethrower-turret') then exp = config.XP['enemy_killed'] * (config.alien_experience_modifiers[entity_name] or 1) floating_text_position = cause.position else diff --git a/map_gen/maps/danger_ores/modules/container_dump.lua b/map_gen/maps/danger_ores/modules/container_dump.lua index 3762da038..4404b18bb 100644 --- a/map_gen/maps/danger_ores/modules/container_dump.lua +++ b/map_gen/maps/danger_ores/modules/container_dump.lua @@ -18,6 +18,31 @@ Global.register( local Public = {} +local cause_by_type = { + ['character'] = function(cause) + return cause.player + end, + ['car'] = function(cause) + local d = cause.get_driver() + if d then + return (d.object_name == 'LuaEntity') and d.player or d + else + return cause.last_user + end + end, + ['spider-vehicle'] = function(cause) + local d = cause.get_driver() + if d then + return (d.object_name == 'LuaEntity') and d.player or d + else + return cause.last_user + end + end, + ['land-mine'] = function(cause) + return cause.last_user + end, +} + Public.register = function(config) local entity_name = config.entity_name or 'coal' Event.add( @@ -76,6 +101,25 @@ Public.register = function(config) end died_entities[entity.unit_number] = true + + local cause = event.cause + if not (cause and cause.valid and cause.force and cause.force.name == 'player') then + return + end + + local handler = cause_by_type[cause.type] + local actor = handler and handler(cause) + if not (actor and actor.valid) then + return + end + + local character = actor.character + if not (character and character.valid) then + return + end + + actor.print('The ore fights back!', { color = { 255, 128, 0 } }) + character.die(game.forces.neutral) end ) From 5e92acf35109298b8045fbb806db28566065f052 Mon Sep 17 00:00:00 2001 From: RedRafe Date: Fri, 20 Feb 2026 12:27:53 +0100 Subject: [PATCH 2/6] Update market chest exchange values --- config.lua | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/config.lua b/config.lua index 7188b0e88..995b1a83a 100644 --- a/config.lua +++ b/config.lua @@ -590,11 +590,11 @@ storage.config = { market_provides_chests = true, -- What market provides offers = { - ['coal'] = 2, - ['copper-ore'] = 2, - ['iron-ore'] = 2, - ['stone'] = 2, - ['uranium-ore'] = 10, + ['coal'] = 5, + ['copper-ore'] = 5, + ['iron-ore'] = 5, + ['stone'] = 5, + ['uranium-ore'] = 25, }, -- What market requests requests = { From 02bf06ac820ac2de6e2b13f8c0a0d034f1f77703 Mon Sep 17 00:00:00 2001 From: RedRafe Date: Mon, 23 Feb 2026 10:21:24 +0100 Subject: [PATCH 3/6] Diggy updates --- .../maps/diggy/feature/blueprint_tools.lua | 6 +++++ map_gen/maps/diggy/feature/night_time.lua | 24 ++++++------------- map_gen/maps/diggy/presets/danger_ores.lua | 2 +- .../maps/diggy/presets/danger_ores_BnB.lua | 2 +- map_gen/maps/diggy/scenario.lua | 1 + 5 files changed, 16 insertions(+), 19 deletions(-) diff --git a/map_gen/maps/diggy/feature/blueprint_tools.lua b/map_gen/maps/diggy/feature/blueprint_tools.lua index 1d8bc47d2..e19a3439f 100644 --- a/map_gen/maps/diggy/feature/blueprint_tools.lua +++ b/map_gen/maps/diggy/feature/blueprint_tools.lua @@ -25,6 +25,7 @@ local Ranks = require 'resources.ranks' local Settings = require 'utils.redmew_settings' local Template = require 'map_gen.maps.diggy.template' +local is_diggy_rock = Template.is_diggy_rock local is_support_beam = Template.is_support_beam local required_rank = Ranks.regular local ENTITIES = prototypes.entity @@ -189,6 +190,11 @@ local function on_marked_for_deconstruction(event) name = entity.surface.get_tile(entity.position.x, entity.position.y).name end + -- Rocks are always allowed + if is_diggy_rock(name) then + return + end + -- Entity is not a support if not is_support_beam(name) then return diff --git a/map_gen/maps/diggy/feature/night_time.lua b/map_gen/maps/diggy/feature/night_time.lua index bc1d7d780..a9e92880d 100644 --- a/map_gen/maps/diggy/feature/night_time.lua +++ b/map_gen/maps/diggy/feature/night_time.lua @@ -3,7 +3,6 @@ -- @module NightTime -- - -- dependencies local Event = require 'utils.event' local RS = require 'map_gen.shared.redmew_surface' @@ -19,30 +18,17 @@ local NightTime = {} local function on_built_entity(event) local player = game.get_player(event.player_index) local entity = event.entity - if (entity.name == 'solar-panel') then - Popup.player( - player, {'diggy.night_time_warning'} - ) + if entity.name == 'solar-panel' then + Popup.player(player, { 'diggy.night_time_warning' }) end end ---- Event handler for on_research_finished --- sets the force, which the research belongs to, recipe for solar-panel-equipment --- to false, to prevent wastefully crafting. The technology is needed for further progression --- @param event table containing the on_research_finished event specific attributes --- -local function on_research_finished(event) - local force = event.research.force - force.recipes["solar-panel-equipment"].enabled = false -end - --- Setup of on_built_entity and on_research_finished events -- assigns the two events to the corresponding local event handlers -- @param config table containing the configurations for NightTime.lua -- function NightTime.register() Event.add(defines.events.on_built_entity, on_built_entity) - Event.add(defines.events.on_research_finished, on_research_finished) end --- Sets the daytime to 0.5 and freezes the day/night circle. @@ -51,8 +37,12 @@ end function NightTime.on_init() local surface = RS.get_surface() - surface.daytime = 0.5 + surface.daytime = 0.42 --0.5 surface.freeze_daytime = true + surface.solar_power_multiplier = 0 + surface.min_brightness = 0.11 + surface.show_clouds = false + surface.brightness_visual_weights = { 1 / 0.85, 1 / 0.85, 1 / 0.85 } end return NightTime diff --git a/map_gen/maps/diggy/presets/danger_ores.lua b/map_gen/maps/diggy/presets/danger_ores.lua index b414ca1b0..cb85ffbf9 100644 --- a/map_gen/maps/diggy/presets/danger_ores.lua +++ b/map_gen/maps/diggy/presets/danger_ores.lua @@ -361,7 +361,7 @@ local config = { entity_name = 'coal', }, disable_mining_productivity = { - enabled = true, + enabled = false, load = function() return require 'map_gen.maps.diggy.feature.mining_productivity' end, replace = script.active_mods['redmew-data'] == nil, -- replace mining productivity with robot cargo capacity }, diff --git a/map_gen/maps/diggy/presets/danger_ores_BnB.lua b/map_gen/maps/diggy/presets/danger_ores_BnB.lua index 76f8a392c..d78bfbd70 100644 --- a/map_gen/maps/diggy/presets/danger_ores_BnB.lua +++ b/map_gen/maps/diggy/presets/danger_ores_BnB.lua @@ -361,7 +361,7 @@ local config = { entity_name = 'coal', }, disable_mining_productivity = { - enabled = true, + enabled = false, load = function() return require 'map_gen.maps.diggy.feature.mining_productivity' end, replace = script.active_mods['redmew-data'] == nil, -- replace mining productivity with robot cargo capacity }, diff --git a/map_gen/maps/diggy/scenario.lua b/map_gen/maps/diggy/scenario.lua index 8598d4dbf..e7525a6fe 100644 --- a/map_gen/maps/diggy/scenario.lua +++ b/map_gen/maps/diggy/scenario.lua @@ -53,6 +53,7 @@ function Scenario.register(diggy_config) -- disabled redmew features for diggy local redmew_config = storage.config redmew_config.market.enabled = false + redmew_config.redmew_surface.enabled = false redmew_config.reactor_meltdown.enabled = false redmew_config.hodor.enabled = false redmew_config.paint.enabled = false From 682f440625ad5fc7babd17ab2a6d0d6138c667ee Mon Sep 17 00:00:00 2001 From: RedRafe Date: Mon, 23 Feb 2026 15:28:47 +0100 Subject: [PATCH 4/6] Revert c dump module changes --- .../danger_ores/modules/container_dump.lua | 46 +------------------ 1 file changed, 1 insertion(+), 45 deletions(-) diff --git a/map_gen/maps/danger_ores/modules/container_dump.lua b/map_gen/maps/danger_ores/modules/container_dump.lua index 4404b18bb..5da601d83 100644 --- a/map_gen/maps/danger_ores/modules/container_dump.lua +++ b/map_gen/maps/danger_ores/modules/container_dump.lua @@ -18,31 +18,6 @@ Global.register( local Public = {} -local cause_by_type = { - ['character'] = function(cause) - return cause.player - end, - ['car'] = function(cause) - local d = cause.get_driver() - if d then - return (d.object_name == 'LuaEntity') and d.player or d - else - return cause.last_user - end - end, - ['spider-vehicle'] = function(cause) - local d = cause.get_driver() - if d then - return (d.object_name == 'LuaEntity') and d.player or d - else - return cause.last_user - end - end, - ['land-mine'] = function(cause) - return cause.last_user - end, -} - Public.register = function(config) local entity_name = config.entity_name or 'coal' Event.add( @@ -101,25 +76,6 @@ Public.register = function(config) end died_entities[entity.unit_number] = true - - local cause = event.cause - if not (cause and cause.valid and cause.force and cause.force.name == 'player') then - return - end - - local handler = cause_by_type[cause.type] - local actor = handler and handler(cause) - if not (actor and actor.valid) then - return - end - - local character = actor.character - if not (character and character.valid) then - return - end - - actor.print('The ore fights back!', { color = { 255, 128, 0 } }) - character.die(game.forces.neutral) end ) @@ -147,4 +103,4 @@ Public.register = function(config) ) end -return Public +return Public \ No newline at end of file From eca756aada6e1a0866d2f1ae84392bce0adb50a8 Mon Sep 17 00:00:00 2001 From: RedRafe Date: Mon, 23 Feb 2026 15:31:10 +0100 Subject: [PATCH 5/6] Revert market chest changes --- config.lua | 10 +++++----- map_gen/maps/danger_ores/modules/container_dump.lua | 2 +- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/config.lua b/config.lua index 995b1a83a..7188b0e88 100644 --- a/config.lua +++ b/config.lua @@ -590,11 +590,11 @@ storage.config = { market_provides_chests = true, -- What market provides offers = { - ['coal'] = 5, - ['copper-ore'] = 5, - ['iron-ore'] = 5, - ['stone'] = 5, - ['uranium-ore'] = 25, + ['coal'] = 2, + ['copper-ore'] = 2, + ['iron-ore'] = 2, + ['stone'] = 2, + ['uranium-ore'] = 10, }, -- What market requests requests = { diff --git a/map_gen/maps/danger_ores/modules/container_dump.lua b/map_gen/maps/danger_ores/modules/container_dump.lua index 5da601d83..3762da038 100644 --- a/map_gen/maps/danger_ores/modules/container_dump.lua +++ b/map_gen/maps/danger_ores/modules/container_dump.lua @@ -103,4 +103,4 @@ Public.register = function(config) ) end -return Public \ No newline at end of file +return Public From 59bff3753c7c08fbd10e0f931e5631861759e54d Mon Sep 17 00:00:00 2001 From: RedRafe Date: Mon, 23 Feb 2026 15:32:28 +0100 Subject: [PATCH 6/6] Revert changes to experience --- features/gui/experience.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/features/gui/experience.lua b/features/gui/experience.lua index 3cbacd6d3..ce2113975 100644 --- a/features/gui/experience.lua +++ b/features/gui/experience.lua @@ -484,7 +484,7 @@ local function on_entity_died(event) -- stuff killed by the player force, but not the player if force and force.name == 'player' then - if cause and cause.valid and (cause.name == 'artillery-turret' or cause.name == 'gun-turret' or cause.name == 'laser-turret' or cause.name == 'flamethrower-turret') then + if cause and (cause.name == 'artillery-turret' or cause.name == 'gun-turret' or cause.name == 'laser-turret' or cause.name == 'flamethrower-turret') then exp = config.XP['enemy_killed'] * (config.alien_experience_modifiers[entity_name] or 1) floating_text_position = cause.position else