1
0
mirror of https://github.com/Refactorio/RedMew.git synced 2025-09-16 09:16:22 +02:00

Removed error when a fish is mined and fixed walk distance calculation #51

This commit is contained in:
Valansch
2017-09-09 22:25:47 +02:00
parent b311be2190
commit e989c8e37f
2 changed files with 1 additions and 5 deletions

View File

@@ -131,10 +131,6 @@ local function preplayer_mined_item(event)
end
end
if event.entity.name == "fish" then
fish_earned(event, 0)
end
if event.entity.name == "stone-rock" then
fish_earned(event, 10)
end

View File

@@ -5,7 +5,7 @@ function walk_distance_on_second()
for _,v in pairs(game.players) do
if (v.afk_time < 30 or v.walking_state.walking) and v.vehicle == nil then
d_x = last_positions[v.name].x - v.position.x
d_x = last_positions[v.name].x - v.position.x
d_y = last_positions[v.name].y - v.position.y
global.scenario.variables.player_walk_distances[v.name] = global.scenario.variables.player_walk_distances[v.name] + math.sqrt(d_x*d_x + d_y*d_y)
global.scenario.variables.player_positions[v.name] = v.position
end