Skip to content

Commit

Permalink
Mtn: fix broken logic
Browse files Browse the repository at this point in the history
  • Loading branch information
Gerkiz committed Oct 26, 2024
1 parent c78ec66 commit ae572fa
Showing 1 changed file with 2 additions and 6 deletions.
8 changes: 2 additions & 6 deletions maps/mountain_fortress_v3/main.lua
Original file line number Diff line number Diff line change
Expand Up @@ -458,7 +458,6 @@ function Public.announce_new_map(current_task)
current_task.state = 'move_players_to_nauvis'
current_task.surface_name = 'nauvis'
current_task.delay = game.tick + 200
current_task.done = true
end

function Public.move_players(current_task)
Expand Down Expand Up @@ -514,20 +513,17 @@ function Public.move_players_to_nauvis(current_task)
end

for _, player in pairs(game.connected_players) do
Public.add_player_to_permission_group(player, 'near_locomotive', true)
local pos = surface.find_non_colliding_position('character', position, 3, 0)
if pos then
player.teleport({ x = pos.x, y = pos.y }, surface)
else
player.teleport({ x = position.x, y = position.y }, surface)
end
Public.add_player_to_permission_group(player, 'near_locomotive', true)
end

current_task.message = 'Moved players back to nauvis!'
if current_task.done then
return
end
current_task.state = 'clear_nauvis'
current_task.done = true
end

function Public.init_stateful(current_task)
Expand Down

0 comments on commit ae572fa

Please sign in to comment.