Kreolix / CovenantMissionHelper

10 stars 8 forks source link

'Optimize' Lua error #17

Closed reaper666735 closed 3 years ago

reaper666735 commented 3 years ago

Hello,

just downloaded your addon and when i tried the "Optimize" button i get this Lua error:

1x CovenantMissionHelper\Board.lua:331: attempt to index field '?' (a nil value) [string "@CovenantMissionHelper\Board.lua"]:331: in function onUnitTakeDamage' [string "@CovenantMissionHelper\Board.lua"]:296: in functionmakeUnitAction' [string "@CovenantMissionHelper\Board.lua"]:161: in function fight' [string "@CovenantMissionHelper\Board.lua"]:142: in functionsimulate' [string "@CovenantMissionHelper\MetaBoard.lua"]:46: in function findBestDisposition' [string "@CovenantMissionHelper\CovenantMissionHelper-0.1.lua"]:55: in functionfindBestDisposition' [string "@CovenantMissionHelper\UI.lua"]:94: in function <CovenantMissionHelper\UI.lua:93>

Locals: self =

{ hasRandomSpells = false initialEnemiesHP = 6920 initialAlliesHP = 4740 units =
{ } isEmpty = false max_rounds = 100 missionID = 2201 isMissionOver = false isCalcRandom = false winXP = 1600 baseXP = 400 probability = 100 } spellID = 11 casterBoardIndex =
{ isAutoTroop = false followerGUID = "0x0000000025003044" role = 1 maxHealth = 1320 spells =
{ } boardIndex = 2 untargetable = false currentHealth = 694 isLoseLvlUp = false name = "Kleia" isWinLvlUp = true ID = 1260 buffs =
{ } reflect = 33 attack = 132 } eventTargetInfo =
{ oldHealth = 9 boardIndex = 6 points = 33 maxHealth = 2640 newHealth = 0 } (temporary) = defined @CovenantMissionHelper\CovenantMissionHelper.lua:154 (temporary) =
{ Spell =
{ } Buff =
{ } Unit =
{ } log = defined @CovenantMissionHelper\CovenantMissionHelper.lua:154 debug_log = defined @CovenantMissionHelper\CovenantMissionHelper.lua:159 MetaBoard =
{ } TargetManager =
{ } DataTables =
{ } Board =
{ } } (temporary) = defined =[C]:-1 (temporary) = "|cFFFF7700 %s kill %s |r" (temporary) = nil (temporary) =
{ 1 =
{ } } (temporary) = defined =[C]:-1 (temporary) = "attempt to index field '?' (a nil value)"

reaper666735 commented 3 years ago

another bug when you use "Troops" in the battle

4x CovenantMissionHelper\Board.lua:99: attempt to perform arithmetic on field 'xp' (a nil value) [string "@CovenantMissionHelper\Board.lua"]:99: in function new' [string "@CovenantMissionHelper\CovenantMissionHelper-0.1.lua"]:29: in function <...dOns\CovenantMissionHelper\CovenantMissionHelper.lua:25> [string "@CovenantMissionHelper\CovenantMissionHelper-0.1.lua"]:37: in functionsimulateFight' [string "@CovenantMissionHelper\CovenantMissionHelper-0.1.lua"]:20: in function <...dOns\CovenantMissionHelper\CovenantMissionHelper.lua:15>

string "=[C]": in function UpdateAllyPower' [string "@Blizzard_GarrisonUI\Blizzard_CovenantMissionUI.lua"]:647: in functionAssignFollowerToMission' [string "@Blizzard_GarrisonUI\Blizzard_CovenantMissionUI.lua"]:472: in function ptr' [string "@SharedXML\CallbackRegistry.lua"]:55: in functionTriggerEvent' [string "@Blizzard_GarrisonUI\Blizzard_AdventuresPuck.lua"]:426: in function <...dOns\Blizzard_GarrisonUI\Blizzard_AdventuresPuck.lua:423>

Locals: self =

{ checkMissionOver = defined @CovenantMissionHelper\Board.lua:186 Errors =
{ } constructResultString = defined @CovenantMissionHelper\Board.lua:382 getTargetIndexes = defined @CovenantMissionHelper\Board.lua:410 simulate = defined @CovenantMissionHelper\Board.lua:123 onUnitTakeDamage = defined @CovenantMissionHelper\Board.lua:328 getTurnOrder = defined @CovenantMissionHelper\Board.lua:227 isTargetableUnit = defined @CovenantMissionHelper\Board.lua:214 new = defined @CovenantMissionHelper\Board.lua:38 makeUnitAction = defined @CovenantMissionHelper\Board.lua:253 CombatLogEvents =
{ } getTargetableUnits = defined @CovenantMissionHelper\Board.lua:218 __index =
{ } HiddenCombatLog =
{ } getTotalLostHP = defined @CovenantMissionHelper\Board.lua:336 isWin = defined @CovenantMissionHelper\Board.lua:401 CombatLog =
{ } getMyTeam = defined @CovenantMissionHelper\Board.lua:353 manageBuffsFromDeadUnits = defined @CovenantMissionHelper\Board.lua:316 fight = defined @CovenantMissionHelper\Board.lua:145 manageAppliedBuffs = defined @CovenantMissionHelper\Board.lua:302 setHasRandomSpells = defined @CovenantMissionHelper\Board.lua:169 isUnitAlive = defined @CovenantMissionHelper\Board.lua:206 } missionPage = { EncounterIcon = { } StartMissionFrame = { } CostFrame = { } mentorLevel = 0 StartMissionButton = { } SetFollowerListSortFuncsForMission = defined @Blizzard_GarrisonUI\Blizzard_GarrisonMissionUI.lua:1356 mentorItemLevel = 0 FollowerBackground = { } IconBG = { } Stage = { } UpdateFollowerModel = defined @Blizzard_GarrisonUI\Blizzard_GarrisonMissionUI.lua:1361 missionEffects =
{ } lastUpdate = 8327.086000 EmptyString = { } GetFollowerFrameFromID = defined @Blizzard_GarrisonUI\Blizzard_GarrisonMissionUI.lua:1384 CalculateDurabilityLoss = defined @Blizzard_GarrisonUI\Blizzard_GarrisonMissionUI.lua:1432 EnemyBackground = { } missionInfo =
{ } UpdatePortraitPulse = defined @Blizzard_GarrisonUI\Blizzard_CovenantMissionUI.lua:964 UpdateEmptyString = defined @Blizzard_GarrisonUI\Blizzard_GarrisonMissionUI.lua:1376 Board = { } SetCounters = defined @Blizzard_GarrisonUI\Blizzard_GarrisonMissionUI.lua:1352 0 = CheckCounter = defined @Blizzard_GarrisonTemplates\Blizzard_GarrisonMissionTemplates.lua:2322 BoardDropShadow = { } CloseButton = { } NineSlice = { } AddFollower = defined @Blizzard_GarrisonUI\Blizzard_CovenantMissionUI.lua:948 UpdateFollowerDurability = defined @Blizzard_GarrisonUI\Blizzard_GarrisonMissionUI.lua:1442 ItemLevelHitboxFrame = { } GenerateSuccessTooltip = defined @Blizzard_GarrisonTemplates\Blizzard_GarrisonMissionTemplates.lua:2318 Median = { } } isCalcRandom = false newObj =
{ hasRandomSpells = false initialEnemiesHP = 1392 isEmpty = true units =
{ } initialAlliesHP = 0 max_rounds = 100 missionID = 2168 baseXP = 100 isCalcRandom = false winXP = 100 isMissionOver = false probability = 100 } isCompletedMission = false missionInfo =
{ description = "The problem has gotten even

Amaalaa commented 3 years ago

have the same issue I think. Night Fae. This is when I select optimize. I also get a lua message when I add my troops. will post that in another comment. Message: Interface\AddOns\CovenantMissionHelper\Board.lua:99: attempt to perform arithmetic on field 'xp' (a nil value) Time: Sun Jan 24 11:29:00 2021 Count: 3 Stack: Interface\AddOns\CovenantMissionHelper\Board.lua:99: attempt to perform arithmetic on field 'xp' (a nil value) [string "@Interface\AddOns\CovenantMissionHelper\Board.lua"]:99: in function new' [string "@Interface\AddOns\CovenantMissionHelper\MetaBoard.lua"]:35: in functionnew' [string "@Interface\AddOns\CovenantMissionHelper\CovenantMissionHelper.lua"]:52: in function `findBestDisposition' [string "@Interface\AddOns\CovenantMissionHelper\UI.lua"]:94: in function <Interface\AddOns\CovenantMissionHelper\UI.lua:93>

Locals: self =

{ checkMissionOver = defined @Interface\AddOns\CovenantMissionHelper\Board.lua:186 Errors =
{ } constructResultString = defined @Interface\AddOns\CovenantMissionHelper\Board.lua:382 getTargetIndexes = defined @Interface\AddOns\CovenantMissionHelper\Board.lua:410 simulate = defined @Interface\AddOns\CovenantMissionHelper\Board.lua:123 onUnitTakeDamage = defined @Interface\AddOns\CovenantMissionHelper\Board.lua:328 getTurnOrder = defined @Interface\AddOns\CovenantMissionHelper\Board.lua:227 isTargetableUnit = defined @Interface\AddOns\CovenantMissionHelper\Board.lua:214 new = defined @Interface\AddOns\CovenantMissionHelper\Board.lua:38 makeUnitAction = defined @Interface\AddOns\CovenantMissionHelper\Board.lua:253 CombatLogEvents =
{ } getTargetableUnits = defined @Interface\AddOns\CovenantMissionHelper\Board.lua:218 __index =
{ } HiddenCombatLog =
{ } getTotalLostHP = defined @Interface\AddOns\CovenantMissionHelper\Board.lua:336 isWin = defined @Interface\AddOns\CovenantMissionHelper\Board.lua:401 CombatLog =
{ } getMyTeam = defined @Interface\AddOns\CovenantMissionHelper\Board.lua:353 manageBuffsFromDeadUnits = defined @Interface\AddOns\CovenantMissionHelper\Board.lua:316 fight = defined @Interface\AddOns\CovenantMissionHelper\Board.lua:145 manageAppliedBuffs = defined @Interface\AddOns\CovenantMissionHelper\Board.lua:302 setHasRandomSpells = defined @Interface\AddOns\CovenantMissionHelper\Board.lua:169 isUnitAlive = defined @Interface\AddOns\CovenantMissionHelper\Board.lua:206 } missionPage = { UpdatePortraitPulse = defined @Interface\AddOns\Blizzard_GarrisonUI\Blizzard_CovenantMissionUI.lua:964 EnemyBackground = { } missionEffects =
{ } 0 = StartMissionFrame = { } EmptyString = { } CostFrame = { } mentorLevel = 0 lastUpdate = 2735.089000 CheckCounter = defined @Interface\AddOns\Blizzard_GarrisonTemplates\Blizzard_GarrisonMissionTemplates.lua:2322 GetFollowerFrameFromID = defined @Interface\AddOns\Blizzard_GarrisonUI\Blizzard_GarrisonMissionUI.lua:1384 Median = { } CalculateDurabilityLoss = defined @Interface\AddOns\Blizzard_GarrisonUI\Blizzard_GarrisonMissionUI.lua:1432 missionInfo =
{ } SetFollowerListSortFuncsForMission = defined @Interface\AddOns\Blizzard_GarrisonUI\Blizzard_GarrisonMissionUI.lua:1356 mentorItemLevel = 0 AddFollower = defined @Interface\AddOns\Blizzard_GarrisonUI\Blizzard_CovenantMissionUI.lua:948 StartMissionButton = { } NineSlice = { } Board = { } FollowerBackground = { } SetCounters = defined @Interface\AddOns\Blizzard_GarrisonUI\Blizzard_GarrisonMissionUI.lua:1352 ItemLevelHitboxFrame = { } GenerateSuccessTooltip = defined @Interface\AddOns\Blizzard_GarrisonTemplates\Blizzard_GarrisonMissionTemplates.lua:2318 BoardDropShadow = { } CloseButton = { } IconBG = <unna

Amaalaa commented 3 years ago

Not sure if the same message, but this is when I add a troop (or take them away)

Message: Interface\AddOns\CovenantMissionHelper\Board.lua:99: attempt to perform arithmetic on field 'xp' (a nil value) Time: Sun Jan 24 11:33:26 2021 Count: 5 Stack: Interface\AddOns\CovenantMissionHelper\Board.lua:99: attempt to perform arithmetic on field 'xp' (a nil value) [string "@Interface\AddOns\CovenantMissionHelper\Board.lua"]:99: in function new' [string "@Interface\AddOns\CovenantMissionHelper\CovenantMissionHelper.lua"]:29: in function <...dOns\CovenantMissionHelper\CovenantMissionHelper.lua:25> [string "@Interface\AddOns\CovenantMissionHelper\CovenantMissionHelper.lua"]:37: in functionsimulateFight' [string "@Interface\AddOns\CovenantMissionHelper\CovenantMissionHelper.lua"]:20: in function <...dOns\CovenantMissionHelper\CovenantMissionHelper.lua:15> [string "=[C]"]: in function UpdateAllyPower' [string "@Interface\AddOns\Blizzard_GarrisonUI\Blizzard_CovenantMissionUI.lua"]:647: in functionAssignFollowerToMission' [string "@Interface\AddOns\Blizzard_GarrisonUI\Blizzard_CovenantMissionUI.lua"]:472: in function ptr' [string "@Interface\SharedXML\CallbackRegistry.lua"]:55: in functionTriggerEvent' [string "@Interface\AddOns\Blizzard_GarrisonUI\Blizzard_AdventuresPuck.lua"]:426: in function <...dOns\Blizzard_GarrisonUI\Blizzard_AdventuresPuck.lua:423>

Locals: self =

{ checkMissionOver = defined @Interface\AddOns\CovenantMissionHelper\Board.lua:186 Errors =
{ } constructResultString = defined @Interface\AddOns\CovenantMissionHelper\Board.lua:382 getTargetIndexes = defined @Interface\AddOns\CovenantMissionHelper\Board.lua:410 simulate = defined @Interface\AddOns\CovenantMissionHelper\Board.lua:123 onUnitTakeDamage = defined @Interface\AddOns\CovenantMissionHelper\Board.lua:328 getTurnOrder = defined @Interface\AddOns\CovenantMissionHelper\Board.lua:227 isTargetableUnit = defined @Interface\AddOns\CovenantMissionHelper\Board.lua:214 new = defined @Interface\AddOns\CovenantMissionHelper\Board.lua:38 makeUnitAction = defined @Interface\AddOns\CovenantMissionHelper\Board.lua:253 CombatLogEvents =
{ } getTargetableUnits = defined @Interface\AddOns\CovenantMissionHelper\Board.lua:218 __index =
{ } HiddenCombatLog =
{ } getTotalLostHP = defined @Interface\AddOns\CovenantMissionHelper\Board.lua:336 isWin = defined @Interface\AddOns\CovenantMissionHelper\Board.lua:401 CombatLog =
{ } getMyTeam = defined @Interface\AddOns\CovenantMissionHelper\Board.lua:353 manageBuffsFromDeadUnits = defined @Interface\AddOns\CovenantMissionHelper\Board.lua:316 fight = defined @Interface\AddOns\CovenantMissionHelper\Board.lua:145 manageAppliedBuffs = defined @Interface\AddOns\CovenantMissionHelper\Board.lua:302 setHasRandomSpells = defined @Interface\AddOns\CovenantMissionHelper\Board.lua:169 isUnitAlive = defined @Interface\AddOns\CovenantMissionHelper\Board.lua:206 } missionPage = { UpdatePortraitPulse = defined @Interface\AddOns\Blizzard_GarrisonUI\Blizzard_CovenantMissionUI.lua:964 EnemyBackground = { } missionEffects =
{ } 0 = StartMissionFrame = { } EmptyString = { } CostFrame = { } mentorLevel = 0 lastUpdate = 3191.907000 CheckCounter = defined @Interface\AddOns\Blizzard_GarrisonTemplates\Blizzard_GarrisonMissionTemplates.lua:2322 GetFollowerFrameFromID = defined @Interface\AddOns\Blizzard_GarrisonUI\Blizzard_GarrisonMissionUI.lua:1384 Median = { } CalculateDurabilityLoss = defined @Interface\AddOns\Blizzard_GarrisonUI\Blizzard_GarrisonMissionUI.lua:1432 missionInfo =
{ } SetFollowerListSortFuncsForMission = defined @Interface\AddOns\Blizzard_GarrisonUI\Blizzard_GarrisonMissionUI.lua:1356 mentorIte

Kreolix commented 3 years ago

Fixed in v3.0.1 #18