From fbc1d62c5fea5151273b22b2c9e8143f6684e1fa Mon Sep 17 00:00:00 2001 From: Ben Deutsch Date: Sun, 1 Nov 2015 21:14:16 +0100 Subject: [PATCH] Slight bugfix to PPA --- persistent_player_attributes.lua | 2 ++ 1 file changed, 2 insertions(+) diff --git a/persistent_player_attributes.lua b/persistent_player_attributes.lua index e7b3555..78c69e7 100644 --- a/persistent_player_attributes.lua +++ b/persistent_player_attributes.lua @@ -104,6 +104,8 @@ PPA.set_value = function(player, name, value) local def = PPA.defs[name] local inv = player:get_inventory() local player_name = player:get_player_name() + if value > def.max then value = def.max end + if value < def.min then value = def.min end PPA.read_cache[player_name][name] = value inv:set_stack(name, 1, ItemStack({ name = ":", count = _count_for_val(value, def) })) end