mirror of
https://github.com/ComfyFactory/ComfyFactorio.git
synced 2025-01-26 03:52:22 +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 Functions = require 'maps.mountain_fortress_v3.ic.functions'
|
||||||
local Gui = require 'maps.mountain_fortress_v3.ic.gui'
|
local Gui = require 'maps.mountain_fortress_v3.ic.gui'
|
||||||
|
|
||||||
local round = math.round
|
|
||||||
|
|
||||||
local function validate_player(player)
|
local function validate_player(player)
|
||||||
if not player then
|
if not player then
|
||||||
return false
|
return false
|
||||||
@ -144,7 +142,7 @@ local function draw_minimap(player, surface, position)
|
|||||||
name = 'minimap_frame',
|
name = 'minimap_frame',
|
||||||
position = position,
|
position = position,
|
||||||
surface_index = surface.index,
|
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.'
|
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
|
if player_data.zoom < 0.07 then
|
||||||
player_data.zoom = 0.07
|
player_data.zoom = 0.07
|
||||||
end
|
end
|
||||||
element.zoom = round(player_data.zoom)
|
element.zoom = player_data.zoom
|
||||||
return
|
return
|
||||||
end
|
end
|
||||||
if event.button == defines.mouse_button_type.left then
|
if event.button == defines.mouse_button_type.left then
|
||||||
@ -207,7 +205,7 @@ function Public.toggle_minimap(event)
|
|||||||
if player_data.zoom > 2 then
|
if player_data.zoom > 2 then
|
||||||
player_data.zoom = 2
|
player_data.zoom = 2
|
||||||
end
|
end
|
||||||
element.zoom = round(player_data.zoom)
|
element.zoom = player_data.zoom
|
||||||
return
|
return
|
||||||
end
|
end
|
||||||
if event.button == defines.mouse_button_type.middle then
|
if event.button == defines.mouse_button_type.middle then
|
||||||
|
Loading…
x
Reference in New Issue
Block a user