[svn]Crystal set bug (and fix)

Where bugs go to lie down and rest

Moderator: Moderator

Post Reply
Message
Author
supermini
Uruivellas
Posts: 800
Joined: Tue May 15, 2012 11:44 pm

[svn]Crystal set bug (and fix)

#1 Post by supermini »

Completing the crystal set for brawlers with armor and gauntlets throws a lua error:
Lua error: data/general/objects/boss-artifacts.lua:874:attempt to index field 'combat' (a nil value)

I made a fix, it's not the most elegant, but it works.
Here's a diff:

Code: Select all

Index: boss-artifacts.lua
===================================================================
--- boss-artifacts.lua	(revision 6035)
+++ boss-artifacts.lua	(working copy)
@@ -871,7 +871,9 @@
 			o.set_list = { {"is_crystalline_armor", true} }
 			o.on_set_complete = function(self, who)
 				self.talent_on_spell = { {chance=10, talent="T_MANATHRUST", level=3} }
-				self.combat.talent_on_hit = { T_MANATHRUST = {level=3, chance=10} }
+				if(self.combat) then self.combat.talent_on_hit = { T_MANATHRUST = {level=3, chance=10} }
+					else self.wielder.combat.talent_on_hit = { T_MANATHRUST = {level = 3, chance = 10 }  } 
+				end
 				self:specialSetAdd({"wielder","combat_spellcrit"}, 10)
 				self:specialSetAdd({"wielder","combat_physcrit"}, 10)
 				self:specialSetAdd({"wielder","resists_pen"}, {[engine.DamageType.ARCANE]=20, [engine.DamageType.PHYSICAL]=15})
@@ -879,7 +881,9 @@
 			end
 			o.on_set_broken = function(self, who)
 				self.talent_on_spell = nil
-				self.combat.talent_on_hit = nil
+				if (self.combat) then self.combat.talent_on_hit = nil
+					else self.wielder.combat.talent_on_hit = nil 
+				end
 				game.logPlayer(who, "#GOLD#The humming from the crystalline artifacts fades as they are separated.")
 			end
 
<darkgod> all this fine balancing talk is boring
<darkgod> brb buffing boulder throwers

Post Reply