From 3978b14a29e2f9f6fb028efcebc2a8c7b6923581 Mon Sep 17 00:00:00 2001 From: Wuzzy Date: Mon, 9 Sep 2024 23:23:10 +0200 Subject: [PATCH] Activate minetest.deserialize safety --- init.lua | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/init.lua b/init.lua index b410b02..04d595e 100644 --- a/init.lua +++ b/init.lua @@ -1,7 +1,7 @@ playerphysics = {} local function calculate_attribute_product(player, attribute) - local a = minetest.deserialize(player:get_meta():get_string("playerphysics:physics")) + local a = minetest.deserialize(player:get_meta():get_string("playerphysics:physics"), true) local product = 1 if a == nil or a[attribute] == nil then return product @@ -17,7 +17,7 @@ end function playerphysics.add_physics_factor(player, attribute, id, value) local meta = player:get_meta() - local a = minetest.deserialize(meta:get_string("playerphysics:physics")) + local a = minetest.deserialize(meta:get_string("playerphysics:physics"), true) if a == nil then a = { [attribute] = { [id] = value } } elseif a[attribute] == nil then @@ -32,7 +32,7 @@ end function playerphysics.remove_physics_factor(player, attribute, id) local meta = player:get_meta() - local a = minetest.deserialize(meta:get_string("playerphysics:physics")) + local a = minetest.deserialize(meta:get_string("playerphysics:physics"), true) if a == nil or a[attribute] == nil then -- Nothing to remove return @@ -46,7 +46,7 @@ end function playerphysics.get_physics_factor(player, attribute, id) local meta = player:get_meta() - local a = minetest.deserialize(meta:get_string("playerphysics:physics")) + local a = minetest.deserialize(meta:get_string("playerphysics:physics"), true) if a == nil then return nil elseif a[attribute] == nil then