Skip to content

Commit

Permalink
Harden startup message against mods like Omni that change autoplace c…
Browse files Browse the repository at this point in the history
…ontrols

Resolves pyanodon/pybugreports#586
  • Loading branch information
Septiple committed Aug 31, 2024
1 parent ee0f166 commit f541517
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions control.lua
Original file line number Diff line number Diff line change
Expand Up @@ -109,10 +109,11 @@ end)
script.on_event(defines.events.on_player_created, function(event)
local player = game.players[event.player_index]
player.print({"messages.welcome"})
if game.surfaces['nauvis'].map_gen_settings.autoplace_controls['stone'].richness <= 1 then
local autoplace_controls = game.surfaces['nauvis'].map_gen_settings.autoplace_controls
if autoplace_controls['stone'] and autoplace_controls['stone'].richness <= 1 then
player.print({"messages.warning-no-preset", {"map-gen-preset-name.py-recommended"}})
end
if game.surfaces['nauvis'].map_gen_settings.autoplace_controls['enemy-base'].size > 0 then
if autoplace_controls['enemy-base'] and autoplace_controls['enemy-base'].size > 0 then
player.print({"messages.warning-biters"})
end

Expand Down

0 comments on commit f541517

Please sign in to comment.