Kagamia / WzComparerR2

Maplestory online Extractor
MIT License
406 stars 132 forks source link

KMST 1.2.173: Certain Skill Tooltips give an error #260

Open PirateIzzy opened 4 months ago

PirateIzzy commented 4 months ago

A few new skills were added in KMST 1.2.173 as part of the anniversary event give errors when rendering.

image It applies to skill IDs 80003671, 80003672, and 80003677

Stack trace:

************** Exception Text **************
System.InvalidOperationException: Stack empty.
   at System.ThrowHelper.ThrowInvalidOperationException(ExceptionResource resource)
   at System.Collections.Generic.Stack`1.Pop()
   at WzComparerR2.Calculator.Suffix(List`1 tokens)
   at WzComparerR2.Calculator.Parse(String mathExpression, Decimal[] args)
   at WzComparerR2.CharaSim.SummaryParser.GetSkillSummary(String H, Int32 Level, Dictionary`2 CommonProps, SummaryParams param, SkillSummaryOptions options)
   at WzComparerR2.CharaSim.SummaryParser.GetSkillSummary(Skill skill, Int32 level, StringResult sr, SummaryParams param, SkillSummaryOptions options)
   at WzComparerR2.CharaSimControl.SkillTooltipRender2.RenderSkill(CanvasRegion region, Int32& picH, List`1& splitterH)
   at WzComparerR2.CharaSimControl.SkillTooltipRender2.Render()
   at WzComparerR2.CharaSimControl.AfrmTooltip.PreRender()
   at WzComparerR2.CharaSimControl.AfrmTooltip.Refresh()
   at WzComparerR2.MainForm.quickView(Node node)
   at WzComparerR2.MainForm.advTree2_AfterNodeSelect_2(Object sender, AdvTreeNodeEventArgs e)
   at DevComponents.AdvTree.AdvTreeNodeEventHandler.Invoke(Object sender, AdvTreeNodeEventArgs e)
   at DevComponents.AdvTree.AdvTree.OnAfterNodeSelect(AdvTreeNodeEventArgs args)
   at DevComponents.AdvTree.AdvTree.SelectNode(Node node, eTreeAction action)
   at DevComponents.AdvTree.AdvTree.ٹ(Node ْ, MouseEventArgs ؾ, Point ٧)
   at DevComponents.AdvTree.AdvTree.OnMouseDown(MouseEventArgs e)
   at System.Windows.Forms.Control.WmMouseDown(Message& m, MouseButtons button, Int32 clicks)
   at System.Windows.Forms.Control.WndProc(Message& m)
   at System.Windows.Forms.ScrollableControl.WndProc(Message& m)
   at System.Windows.Forms.Control.ControlNativeWindow.OnMessage(Message& m)
   at System.Windows.Forms.Control.ControlNativeWindow.WndProc(Message& m)
   at System.Windows.Forms.NativeWindow.Callback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)
Kagamia commented 4 months ago

Any details? Could you help post a screenshot for the skill common properties?

PirateIzzy commented 4 months ago

This is from 80003671: image

80003672: image

80003677: image

For comparison this is 80003670, which renders fine: image

I think the reason is because it has an extra ) at the end, i.e. 10*x-5*d(x/2)) instead of 10*x-5*d(x/2)

Kagamia commented 4 months ago

So it is still due to the wrong math expression.

da*n Ne*on

HikariCalyx commented 2 months ago

I created a function named ExcessiveBracketFilter as a workaround for this issue, as shown in this commit: https://github.com/HikariCalyx/WzComparerR2-JMS/commit/a3989c74d02f2346bb9e6546f4ddc64bf59144cb

image Not sure if it's the best workaround.