mirror of
https://github.com/luanti-org/luanti.git
synced 2025-10-22 12:25:23 +02:00
Code style fixes.
This commit is contained in:
@@ -389,7 +389,7 @@ function vector.random_direction()
|
||||
local x, y, z, l2
|
||||
repeat -- expected less than two attempts on average (volume sphere vs. cube)
|
||||
x, y, z = math.random() * 2 - 1, math.random() * 2 - 1, math.random() * 2 - 1
|
||||
l2 = x*x + y*y + z*z
|
||||
l2 = x*x + y*y + z*z
|
||||
until l2 <= 1 and l2 >= 1e-6
|
||||
-- normalize
|
||||
local l = math.sqrt(l2)
|
||||
|
||||
@@ -38,7 +38,7 @@ local function buttonbar_formspec(self)
|
||||
-- `BASE_SPACING` is used as the minimum spacing, like `gap` in CSS Flexbox.
|
||||
|
||||
-- The number of buttons per page is always calculated as if the scroll
|
||||
-- buttons were visible.
|
||||
-- buttons were visible.
|
||||
local avail_space = self.size.x - 2*BASE_SPACING - 2*get_scroll_btn_width()
|
||||
local btns_per_page = math.floor((avail_space - BASE_SPACING) / (btn_size + BASE_SPACING))
|
||||
|
||||
|
||||
@@ -78,7 +78,7 @@ core.register_entity(":__builtin:falling_node", {
|
||||
self.floats = core.get_item_group(node.name, "float") ~= 0
|
||||
|
||||
-- Save liquidtype for falling water
|
||||
self.liquidtype = def.liquidtype
|
||||
self.liquidtype = def.liquidtype
|
||||
|
||||
-- Set entity visuals
|
||||
if def.drawtype == "torchlike" or def.drawtype == "signlike" then
|
||||
|
||||
@@ -36,7 +36,7 @@ end
|
||||
|
||||
|
||||
function core.setting_get_pos(name)
|
||||
return core.settings:get_pos(name)
|
||||
return core.settings:get_pos(name)
|
||||
end
|
||||
|
||||
|
||||
|
||||
@@ -32,7 +32,7 @@ end
|
||||
|
||||
local function clients_list_buttonhandler(this, fields)
|
||||
if fields.quit then
|
||||
this:delete()
|
||||
this:delete()
|
||||
return true
|
||||
end
|
||||
return false
|
||||
|
||||
@@ -76,7 +76,7 @@ end
|
||||
|
||||
local function buttonhandler(this, fields)
|
||||
if fields.quit then
|
||||
this:delete()
|
||||
this:delete()
|
||||
return true
|
||||
end
|
||||
|
||||
|
||||
Reference in New Issue
Block a user