mirror of
https://github.com/ComfyFactory/ComfyFactorio.git
synced 2025-01-10 00:43:27 +02:00
Merge pull request #177 from ComfyFactory/fix_crash
fix hard game crash bug
This commit is contained in:
commit
4e9ea6c4ac
@ -4,8 +4,6 @@ local ICT = require 'maps.mountain_fortress_v3.ic.table'
|
||||
local Functions = require 'maps.mountain_fortress_v3.ic.functions'
|
||||
local Gui = require 'maps.mountain_fortress_v3.ic.gui'
|
||||
|
||||
local round = math.round
|
||||
|
||||
local function validate_player(player)
|
||||
if not player then
|
||||
return false
|
||||
@ -144,7 +142,7 @@ local function draw_minimap(player, surface, position)
|
||||
name = 'minimap_frame',
|
||||
position = position,
|
||||
surface_index = surface.index,
|
||||
zoom = round(player_data.zoom),
|
||||
zoom = player_data.zoom,
|
||||
tooltip = 'LMB: Increase zoom level.\nRMB: Decrease zoom level.\nMMB: Toggle camera size.'
|
||||
}
|
||||
)
|
||||
@ -199,7 +197,7 @@ function Public.toggle_minimap(event)
|
||||
if player_data.zoom < 0.07 then
|
||||
player_data.zoom = 0.07
|
||||
end
|
||||
element.zoom = round(player_data.zoom)
|
||||
element.zoom = player_data.zoom
|
||||
return
|
||||
end
|
||||
if event.button == defines.mouse_button_type.left then
|
||||
@ -207,7 +205,7 @@ function Public.toggle_minimap(event)
|
||||
if player_data.zoom > 2 then
|
||||
player_data.zoom = 2
|
||||
end
|
||||
element.zoom = round(player_data.zoom)
|
||||
element.zoom = player_data.zoom
|
||||
return
|
||||
end
|
||||
if event.button == defines.mouse_button_type.middle then
|
||||
|
Loading…
Reference in New Issue
Block a user