Opened 11 years ago

Closed 11 years ago

Last modified 11 years ago

#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 sanderd17)

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)

fix-no-gain-for-unfinished-market.patch (1.6 KB ) - added by Markus 11 years ago.

Download all attachments as: .zip

Change History (7)

comment:1 by sanderd17, 11 years ago

Description: modified (diff)

comment:2 by Josh, 11 years ago

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.

Last edited 11 years ago by Josh (previous) (diff)

comment:3 by Markus, 11 years ago

In input.js:266 no trader is found as the market is still unfinished.

comment:4 by Markus, 11 years ago

Keywords: patch review added
Milestone: BacklogAlpha 14
Summary: Error when hovering over market with selected unifinished market[PATCH] Error when hovering over market with selected unifinished market

comment:5 by leper, 11 years ago

Owner: set to leper
Resolution: fixed
Status: newclosed

In 13452:

Display expected trading gain (GainMultiplier = 1) for market foundations when setting rally points. Fixes #1963.

comment:6 by leper, 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.