Page 1 of 1
RodOfRecall stop recharging.Any temporary fixes availabe?
Posted: Sun Jan 16, 2011 1:01 pm
by Postman
Kind of tiresome to climb all way back without RoR. I know it's fixed in SVN, but are there any fixes which I can easily copy-past into 18b install?
Re: RodOfRecall stop recharging.Any temporary fixes availabe
Posted: Sun Jan 16, 2011 5:17 pm
by Massimiliano Marangio
I had the same problem in an old beta, and I simply changed the code of the jeweller to also recharge not-charged artifacts, but I don't have the code anymore.
Re: RodOfRecall stop recharging.Any temporary fixes availabe
Posted: Sun Jan 16, 2011 5:49 pm
by yufra
Here are the fixes that are in the SVN and slated for beta19. Everything with a "+" at the beginning of the line should be inserted into the correct file and location. Note that this will disable with online updates so your character sheet on te4.org will stop updating.
Code: Select all
Index: engines/default/engine/Object.lua
===================================================================
--- engines/default/engine/Object.lua (revision 2337)
+++ engines/default/engine/Object.lua (revision 2338)
@@ -52,6 +52,13 @@
end
end
+--- Loaded, we add ourself back to the game
+function _M:loaded()
+ engine.Entity.loaded(self)
+
+ if not game:hasEntity(self) then game:addEntity(self) end
+end
+
--- Can this object act at all
-- Most object will want to answer false, only recharging and stuff needs them
function _M:canAct()
Code: Select all
Index: engines/default/engine/interface/ObjectActivable.lua
===================================================================
--- engines/default/engine/interface/ObjectActivable.lua (revision 2337)
+++ engines/default/engine/interface/ObjectActivable.lua (revision 2338)
@@ -61,6 +61,9 @@
end
function _M:useObject(who, ...)
+ -- Make sure the object is registered with the game, if need be
+ if not game:hasEntity(self) then game:addEntity(self) end
+
if self.use_power then
if self.power >= self.use_power.power then
local rets = { self.use_power.use(self, who, ...) }
Code: Select all
Index: engines/default/engine/interface/ActorInventory.lua
===================================================================
--- engines/default/engine/interface/ActorInventory.lua (revision 2337)
+++ engines/default/engine/interface/ActorInventory.lua (revision 2338)
@@ -103,6 +103,9 @@
self:onAddObject(o)
+ -- Make sure the object is registered with the game, if need be
+ if not game:hasEntity(o) then game:addEntity(o) end
+
return true, #inven
end
@@ -171,6 +174,9 @@
self:onRemoveObject(o)
+ -- Make sure the object is registered with the game, if need be
+ if not game:hasEntity(o) then game:addEntity(o) end
+
return o, finish
end
Code: Select all
Index: engines/default/engine/GameEnergyBased.lua
===================================================================
--- engines/default/engine/GameEnergyBased.lua (revision 2337)
+++ engines/default/engine/GameEnergyBased.lua (revision 2338)
@@ -121,3 +121,8 @@
if not self.entities[e.uid] then error("Entity "..e.uid.." not present in the game") end
self.entities[e.uid] = nil
end
+
+--- Does the game have this entity ?
+function _M:hasEntity(e)
+ return self.entities[e.uid]
+end