Skip to content
Snippets Groups Projects
Commit 77fe071d authored by Hachem_Muche's avatar Hachem_Muche
Browse files

(engine) Entity: Added getTemporaryValue function. Updated some temp value...

(engine) Entity: Added getTemporaryValue function.  Updated some temp value error messages to include name/uid of entity involved.

Fixed a bad reference in damDesc
parent ff51b1ec
No related branches found
No related tags found
No related merge requests found
......@@ -1026,9 +1026,9 @@ function _M:removeTemporaryValue(prop, id, noupdate)
else
if config.settings.cheat then
if type(v) == "nil" then
error("ERROR!!! unsupported temporary value type: "..type(v).." :=: "..tostring(v).." for "..tostring(prop))
error("ERROR!!! unsupported temporary value type: "..type(v).." :=: "..tostring(v).." for "..tostring(prop)..(" [%s] %s"):format(self.uid, self.name))
else
error("unsupported temporary value type: "..type(v).." :=: "..tostring(v).." for "..tostring(prop))
error("unsupported temporary value type: "..type(v).." :=: "..tostring(v).." for "..tostring(prop)..(" [%s] %s"):format(self.uid, self.name))
end
end
end
......@@ -1040,6 +1040,12 @@ function _M:removeTemporaryValue(prop, id, noupdate)
end
end
--- Returns a previously set temporary value, see addTemporaryValue()
-- @int id the index of the previously set property
function _M:getTemporaryValue(id)
return self.compute_vals and self.compute_vals[id]
end
--- Helper function to add temporary values
-- @param[type=table] t
-- @param k
......
......@@ -62,7 +62,7 @@ damDesc = function(self, type, dam)
dam = dam * 0.4
end
if self:attr("invisible_damage_penalty") then
dam = dam * util.bound(1 - (src.invisible_damage_penalty / (src.invisible_damage_penalty_divisor or 1)), 0, 1)
dam = dam * util.bound(1 - (self.invisible_damage_penalty / (self.invisible_damage_penalty_divisor or 1)), 0, 1)
end
if self:attr("numbed") then
dam = dam - dam * self:attr("numbed") / 100
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment