[1.6.0 + orcs 1.0.5] Innovation will cause item bug
Posted: Fri Oct 25, 2019 10:24 am
Innovation is a talent in Orcs DLC, that will increase equipments you wear's stats by a percent.
However, if you wear an equipment with innovation, then hand it to another actor, it will cause a bug when take off it.
Steps to reproduce:
Let an actor learn Innovation.
Wear an equipment with master/steamtech power source.
Take it off and hand it to another actor (i.e. your golem)
Order another actor it to wear it, then take off it. The bug occured.
This will also occur to enemies' drop if the enemy have Innovation, which will be common for steam classes.
The equipment will be lost permanently in this process. If you are using another equipment to replace it, both equipment will be lost.
When we investigate into the code about this talent in `tome-orcs/superload/mod/class/Actor.lua`
`__innovation_adds` is will the code store the temporary stats provided by innovation. However, on taking off this equipment, it will remove the temporary stats, but not `__innovation_adds` property itself.
Then, when another actor trying to wear off it, it will trying to remove an non-exist temporary value. This attempt will trigger an error, and the equipment will be lost.
However, if you wear an equipment with innovation, then hand it to another actor, it will cause a bug when take off it.
Steps to reproduce:
Let an actor learn Innovation.
Wear an equipment with master/steamtech power source.
Take it off and hand it to another actor (i.e. your golem)
Order another actor it to wear it, then take off it. The bug occured.
This will also occur to enemies' drop if the enemy have Innovation, which will be common for steam classes.
The equipment will be lost permanently in this process. If you are using another equipment to replace it, both equipment will be lost.
When we investigate into the code about this talent in `tome-orcs/superload/mod/class/Actor.lua`
Code: Select all
--- Call when an object is taken off
local onTakeoff = _M.onTakeoff
function _M:onTakeoff(o, inven_id, bypass_set)
onTakeoff(self, o, inven_id, bypass_set)
if o.__innovation_adds then
o:tableTemporaryValuesRemove(o.__innovation_adds)
end
end
Then, when another actor trying to wear off it, it will trying to remove an non-exist temporary value. This attempt will trigger an error, and the equipment will be lost.