Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

GSText displays negative values as two's complement in goal window. #5419

Closed
DorpsGek opened this issue Dec 29, 2012 · 6 comments
Closed

GSText displays negative values as two's complement in goal window. #5419

DorpsGek opened this issue Dec 29, 2012 · 6 comments
Labels
component: AI/Game script (squirrel) This issue is related to Squirrel (Scripting language) flyspray This issue is imported from FlySpray (https://bugs.openttd.org/)

Comments

@DorpsGek
Copy link
Member

oh8hth opened the ticket and wrote:

Version is 1.3.0-beta1.
To reproduce:
In english.txt:
STR_NUMBER :{NUM}
In code:
GSGoal.New(0, GSText(GSText.STR_NUMBER, -1), GSGoal.GT_NONE, 0);

Relevant lines of code:
In english.txt:
STR_BALANCE_2 :{BLACK}Cash {CURRENCY_SHORT} {RED}Debt {NUM}
- both {CURRENCY_SHORT} and {NUM} do the same thing.
in code:
_cash = GSCompany.GetBankBalance(_company);
_debt = GSCompany.GetLoanAmount();
(...)
infotext2.AddParam(_equity._cash);
infotext2.AddParam(_equity._debt.tointeger());
_goal2 = GSGoal.New(0, infotext2, gt, 0);
- the presence or absence of .tointeger() doesn't make a difference.

Attachments: savegame, the script in question (work in progress, all code is in main.nut at the moment), its english.txt.

Attachments

Reported version: 1.2.3
Operating system: All


This issue was imported from FlySpray: https://bugs.openttd.org/task/5419
@DorpsGek
Copy link
Member Author

oh8hth wrote:

Savegame was missing.

Attachments


This comment was imported from FlySpray: https://bugs.openttd.org/task/5419#comment11830

@DorpsGek
Copy link
Member Author

DorpsGek commented Jan 7, 2013

Zuu wrote:

Confirmed in 1.2.3 and trunk (r24892).


This comment was imported from FlySpray: https://bugs.openttd.org/task/5419#comment11859

@DorpsGek
Copy link
Member Author

DorpsGek commented Jan 8, 2013

Zuu wrote:

A comment on this bug can be found in the IRC logs of # openttd.dev:
http://webster.openttdcoop.org/?channel=openttd.dev&date=1357516800# 1357601369


This comment was imported from FlySpray: https://bugs.openttd.org/task/5419#comment11860

@DorpsGek
Copy link
Member Author

DorpsGek commented Jan 8, 2013

Zuu wrote:

A short but complete GS to reproduce the reported bug.

Juhana: you need to include also info.nut in order for the GS to be complete and easily usable with OpenTTD. Preferable pack everything in a tar for example using the python script make_tar.py which is included with the "Minimal GS" pack or use eg. 7zip to create a tar. Additionally, bug reports benefit by having the smallest complexity required to reproduce the bug. If passing just -1 is enough, don't include lots of code that compute -1, just put a literal -1 in the code. That simplifies your bug report.

That being said, thank you for taking your time and reporting bugs that you encounter so that they can get fixed.

Attachments


This comment was imported from FlySpray: https://bugs.openttd.org/task/5419#comment11861

@DorpsGek
Copy link
Member Author

DorpsGek commented Jan 8, 2013

oh8hth wrote:

Leif: thank you for the information. I will include the complete tar file as soon as I have time. This is both my first GS and my first OpenTTD bug report ever, so point taken ;)


This comment was imported from FlySpray: https://bugs.openttd.org/task/5419#comment11863

@DorpsGek
Copy link
Member Author

Zuu closed the ticket.

Reason for closing: Fixed

Fixed in r24908


This comment was imported from FlySpray: https://bugs.openttd.org/task/5419

@DorpsGek DorpsGek added flyspray This issue is imported from FlySpray (https://bugs.openttd.org/) Goal/Game script labels Apr 7, 2018
@frosch123 frosch123 added the component: AI/Game script (squirrel) This issue is related to Squirrel (Scripting language) label Apr 14, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
component: AI/Game script (squirrel) This issue is related to Squirrel (Scripting language) flyspray This issue is imported from FlySpray (https://bugs.openttd.org/)
Projects
None yet
Development

No branches or pull requests

2 participants