1
0
mirror of https://github.com/Refactorio/RedMew.git synced 2024-12-12 10:04:40 +02:00

fixed walkabout bug

This commit is contained in:
grilledham 2018-06-18 22:45:11 +01:00
parent 1e76216b7f
commit 3760833a96

View File

@ -137,6 +137,11 @@ local function walkabout(cmd)
local pos = {x = chunk.x * 32, y = chunk.y * 32}
local non_colliding_pos = surface.find_non_colliding_position('player', pos, 100, 1)
local character = player.character
if character and character.valid then
character.walking_state = {walking = false}
end
if non_colliding_pos then
game.print(player_name .. ' went on a walkabout, to find himself.')
Task.set_timeout(
@ -146,7 +151,7 @@ local function walkabout(cmd)
player = player,
force = player.force,
position = {x = player.position.x, y = player.position.y},
character = player.character
character = character
}
)
player.character = nil