mirror of
https://github.com/minetest-mods/3d_armor.git
synced 2024-11-26 06:13:45 +01:00
Fix movement and level bugs
This commit is contained in:
parent
fe9664589a
commit
3aac5c98f4
@ -157,13 +157,12 @@ armor.set_player_armor = function(self, player)
|
||||
local groups = {}
|
||||
local change = {}
|
||||
for _, phys in pairs(self.physics) do
|
||||
physics[phys] = 0
|
||||
physics[phys] = 1
|
||||
end
|
||||
for _, attr in pairs(self.attributes) do
|
||||
attributes[attr] = 0
|
||||
end
|
||||
for group, base in pairs(self.registered_groups) do
|
||||
groups[group] = base
|
||||
for group, _ in pairs(self.registered_groups) do
|
||||
change[group] = 1
|
||||
levels[group] = 0
|
||||
end
|
||||
@ -218,7 +217,6 @@ armor.set_player_armor = function(self, player)
|
||||
end
|
||||
for group, level in pairs(levels) do
|
||||
if level > 0 then
|
||||
local base = self.registered_groups[group]
|
||||
if minetest.get_modpath("shields") then
|
||||
level = level * 0.9
|
||||
end
|
||||
@ -226,6 +224,8 @@ armor.set_player_armor = function(self, player)
|
||||
level = level * 1.1
|
||||
end
|
||||
level = level * armor.config.level_multiplier
|
||||
end
|
||||
local base = self.registered_groups[group]
|
||||
self.def[name].groups[group] = level
|
||||
if level > base then
|
||||
level = base
|
||||
@ -233,7 +233,6 @@ armor.set_player_armor = function(self, player)
|
||||
groups[group] = base - level
|
||||
change[group] = groups[group] / base
|
||||
end
|
||||
end
|
||||
for _, attr in pairs(self.attributes) do
|
||||
self.def[name][attr] = attributes[attr]
|
||||
end
|
||||
|
Loading…
Reference in New Issue
Block a user