Possible Item Activation Fix
Posted: Fri Mar 11, 2011 4:20 am
Started digging around tonight with the help of Marcotte on IRC and found this in module Object.lua line 87
Marcotte and Grey suggested swapping the useObject and the useEnergy around.
Initial testing of this fixes the item activation bug with targeted items (and I tested a non-targeted item to make sure they still worked alright). Maybe I'm missing something crucial, I don't know. But it looks like a potential fix.
Code: Select all
if typ == "use" then
who:useEnergy(game.energy_to_act * (inven.use_speed or 1))
if self.use_sound then game:playSoundNear(who, self.use_sound) end
return self:useObject(who, inven, item)
end
Code: Select all
if typ == "use" then
self:useObject(who, inven, item)
if self.use_sound then game:playSoundNear(who, self.use_sound) end
return who:useEnergy(game.energy_to_act * (inven.use_speed or 1))
end