#1963 closed defect (fixed)
[PATCH] Error when hovering over market with selected unifinished market
Reported by: | sanderd17 | Owned by: | leper |
---|---|---|---|
Priority: | Must Have | Milestone: | Alpha 14 |
Component: | UI & Simulation | Keywords: | patch |
Cc: | Patch: |
Description (last modified by )
Steps to reproduce:
- start building a market
- select that market
- hoover an existing market while the other one is not finished yet
This results in the following error:
ERROR: JavaScript error: simulation/helpers/TraderGain.js line 28 TypeError: template is undefined CalculateTraderGain(9827,7895,(void 0))@simulation/helpers/TraderGain.js:28 (1,[object Object])@simulation/components/GuiInterface.js:1614 (1,"GetTradingRouteGain",[object Object])@simulation/components/GuiInterface.js:1767 ERROR: Error calling component script function ScriptCall
The error is repeated as long as you hoover the existing market, but doesn't appear again when your new market is finished building.
Attachments (1)
Change History (7)
comment:1 by , 11 years ago
Description: | modified (diff) |
---|
comment:4 by , 11 years ago
Keywords: | patch review added |
---|---|
Milestone: | Backlog → Alpha 14 |
Summary: | Error when hovering over market with selected unifinished market → [PATCH] Error when hovering over market with selected unifinished market |
by , 11 years ago
Attachment: | fix-no-gain-for-unfinished-market.patch added |
---|
comment:6 by , 11 years ago
Keywords: | review removed |
---|
Thanks for the patch, but I think displaying a gain (even if it isn't fully accurate) is better than not displaying anything. Also check the irc log starting at 20:22.
Note:
See TracTickets
for help on using tickets.
Something in the GUI seems to be not properly passing a template to GuiInterface.js:1609 which tries to call TraderGain.js:7 without template data and the function fails at line 28 when it tries to access gain data from the template. A quick and easy fix would be to change line 28 in TraderGain.js to
"if(template && template.GainMultiplier)"
but that would most likely return an incorrect value to the GUI. The best fix would be to trace the call back into the GUI and fix the undefined template there.