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

Made player distance persistent

This commit is contained in:
Valansch 2017-07-21 13:05:26 +02:00
parent 8be41df66c
commit 5f96759833

View File

@ -29,7 +29,9 @@ end
local function init_player_position(event)
local player = game.players[event.player_index]
global.scenario.variables.player_positions[player.name] = player.position
global.scenario.variables.player_walk_distances[player.name] = 0
if not global.scenario.variables.player_walk_distances[player.name] then
global.scenario.variables.player_walk_distances[player.name] = 0
end
end
Event.register(defines.events.on_tick, on_tick)