From 21dd8dbf45f0266bc7607e24c2c785ead6ad2edc Mon Sep 17 00:00:00 2001
From: DarkGod <darkgod@net-core.org>
Date: Sat, 21 Dec 2013 18:34:46 +0100
Subject: [PATCH] Entity:addTemporaryValue will not lose value for
 higest/lowest/last number setting

---
 game/engines/default/engine/Entity.lua | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/game/engines/default/engine/Entity.lua b/game/engines/default/engine/Entity.lua
index 2b2aa94bf0..ac6f47bf58 100644
--- a/game/engines/default/engine/Entity.lua
+++ b/game/engines/default/engine/Entity.lua
@@ -688,15 +688,15 @@ function _M:addTemporaryValue(prop, v, noupdate)
 				b = 1 - (1 - b) * (1 - v)
 				base[prop] = b + 1
 			elseif method == "highest" then
-				base["__thighest_"..prop] = base["__thighest_"..prop] or {}
+				base["__thighest_"..prop] = base["__thighest_"..prop] or {[-1] = base[prop]}
 				base["__thighest_"..prop][id] = v
 				base[prop] = table.max(base["__thighest_"..prop])
 			elseif method == "lowest" then
-				base["__tlowest_"..prop] = base["__tlowest_"..prop] or {}
+				base["__tlowest_"..prop] = base["__tlowest_"..prop] or {[-1] = base[prop]}
 				base["__tlowest_"..prop][id] = v
 				base[prop] = table.min(base["__tlowest_"..prop])
 			elseif method == "last" then
-				base["__tlast_"..prop] = base["__tlast_"..prop] or {}
+				base["__tlast_"..prop] = base["__tlast_"..prop] or {[-1] = base[prop]}
 				local b = base["__tlast_"..prop]
 				b[id] = v
 				b = table.listify(b)
-- 
GitLab