vexler222
Active Member
- Joined
- Apr 22, 2012
- Messages
- 714
- Solutions
- 15
- Reaction score
- 46
Hi, i have addon system for tfs 1.3, and it worked if player has outfit without addons, i change it and working in 50% good, cuz now it work if player has first or second addon, how to fix it? Why it not work, i added first and second addon to check
Code:
function Creature:onChangeOutfit(outfit)
if not self:isPlayer() then
return true
end
if self:hasOutfit(self:getOutfit().lookType, 1) and self:hasOutfit(self:getOutfit().lookType, 2) then
local previousBonusCondition = getBonusCondition(self:getOutfit().lookType)
local newBonusCondition = getBonusCondition(outfit.lookType)
if previousBonusCondition then
self:removeCondition(CONDITION_ATTRIBUTES, CONDITIONID_DEFAULT, previousBonusCondition:getSubId())
end
if newBonusCondition then
self:addCondition(newBonusCondition)
end
end
return true
end