mirror of
https://github.com/Refactorio/RedMew.git
synced 2024-12-14 10:13:13 +02:00
fixed walkabout bug
This commit is contained in:
parent
1e76216b7f
commit
3760833a96
@ -137,6 +137,11 @@ local function walkabout(cmd)
|
|||||||
local pos = {x = chunk.x * 32, y = chunk.y * 32}
|
local pos = {x = chunk.x * 32, y = chunk.y * 32}
|
||||||
local non_colliding_pos = surface.find_non_colliding_position('player', pos, 100, 1)
|
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
|
if non_colliding_pos then
|
||||||
game.print(player_name .. ' went on a walkabout, to find himself.')
|
game.print(player_name .. ' went on a walkabout, to find himself.')
|
||||||
Task.set_timeout(
|
Task.set_timeout(
|
||||||
@ -146,7 +151,7 @@ local function walkabout(cmd)
|
|||||||
player = player,
|
player = player,
|
||||||
force = player.force,
|
force = player.force,
|
||||||
position = {x = player.position.x, y = player.position.y},
|
position = {x = player.position.x, y = player.position.y},
|
||||||
character = player.character
|
character = character
|
||||||
}
|
}
|
||||||
)
|
)
|
||||||
player.character = nil
|
player.character = nil
|
||||||
|
Loading…
Reference in New Issue
Block a user