From 43ccc25792239ebd296d6788a456087dc1d687ad Mon Sep 17 00:00:00 2001 From: Hachem_Muche <Hachem_Muche@stanfordalumni.org> Date: Fri, 1 May 2015 21:47:19 -0700 Subject: [PATCH] Cleanup --- game/modules/tome/class/Actor.lua | 11 ++++------- game/modules/tome/class/interface/ActorObjectUse.lua | 5 ----- 2 files changed, 4 insertions(+), 12 deletions(-) diff --git a/game/modules/tome/class/Actor.lua b/game/modules/tome/class/Actor.lua index 5e23d891bd..6aadf1a40a 100644 --- a/game/modules/tome/class/Actor.lua +++ b/game/modules/tome/class/Actor.lua @@ -3701,11 +3701,10 @@ function _M:onWear(o, inven_id, bypass_set, silent) -- Apply set bonuses. for _, d in pairs(set_objects) do if d.object ~= o then self:onTakeoff(d.object, d.inven_id, true) end - local complete = d.object.on_set_complete + local complete = d.object.on_set_complete if type(complete) == "table" then complete = complete[set_id] end if complete then complete(d.object, self, d.inven_id, set_objects) end if d.object ~= o then self:onWear(d.object, d.inven_id, true) end ---game.log("#YELLOW# completing set with %s", d.object.name) self:useObjectDisable(d.object) self:useObjectEnable(d.object) @@ -3830,7 +3829,7 @@ function _M:onTakeoff(o, inven_id, bypass_set, silent) if d.object ~= o then self:onTakeoff(d.object, d.inven_id, true) end local broken = d.object.on_set_broken if type(broken) == "table" then broken = broken[set_id] end --- if broken then broken(d.object, self, d.inven_id, set_objects) end + if broken then broken(d.object, self, d.inven_id, set_objects) end if d.object._special_set then for k, id in pairs(d.object._special_set) do d.object:removeTemporaryValue(k, id) @@ -3838,10 +3837,8 @@ function _M:onTakeoff(o, inven_id, bypass_set, silent) d.object._special_set = nil end if d.object ~= o then self:onWear(d.object, d.inven_id, true) end ---game.log("#YELLOW# breaking set with %s", d.object.name) - self:useObjectDisable(d.object) - self:useObjectEnable(d.object) - + self:useObjectDisable(d.object) + self:useObjectEnable(d.object) d.object.set_complete[set_id] = nil -- Remove if empty. local empty = true diff --git a/game/modules/tome/class/interface/ActorObjectUse.lua b/game/modules/tome/class/interface/ActorObjectUse.lua index 45728b46d0..d4f966d2e5 100644 --- a/game/modules/tome/class/interface/ActorObjectUse.lua +++ b/game/modules/tome/class/interface/ActorObjectUse.lua @@ -259,8 +259,6 @@ _M.useObjectBaseTalent ={ coroutine.resume(co) end, info = function(self, t) --- local data = self.object_talent_data --- if not data then return "" end local o = t.getObject(self, t) if not (o and o:isIdentified()) then return "Activate an object." end local objname = o:getName({do_color = true}) or "(unknown object)" @@ -270,7 +268,6 @@ _M.useObjectBaseTalent ={ %s]]):format(objname, usedesc) end, short_info = function(self, t) --- local data = self.object_talent_data and self.object_talent_data[t.id] local obj = t.getObject(self, t) return ([[Activate %s]]):format(obj and obj:getName({do_color = true}) or "nothing") end, @@ -286,7 +283,6 @@ function _M:useObjectTalent(base_name, num) t = table.clone(self.useObjectBaseTalent) t.id = tid t.short_name = short_name --- print("ActorObjectUse] Defining new Talent ", short_name) Talents:newTalent(t) -- define this after parsing in data.talents.lua t.tactical = function(self, t) @@ -379,7 +375,6 @@ function _M:useObjectDisable(o, inven_id, slot, tid, base_name) o = data[tid] and data[tid].obj end print(("[ActorObjectUse] useObjectDisable: o: %s, by %s inven/slot = %s/%s"):format(o and o.name or "none", self.name, inven_id, slot)) ---game.log(("#YELLOW#[ActorObjectUse] useObjectDisable: o: %s, by %s inven/slot = %s/%s"):format(o and o.name or "none", self.name, inven_id, slot)) if tid then if data[tid] and data[tid].old_talent_level then self.talents[tid] = data[tid].old_talent_level end -- GitLab