News:

Simutrans Sites
Know our official sites. Find tools and resources for Simutrans.

Pricing is confused

Started by neroden, September 13, 2023, 10:52:47 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

neroden

For construction.  I think this is an artifact of all the bizarre "scaling factors" which I would like to remove from the code; there's clearly duplicated code floating around.

The displayed "how much we think it's going to cost" in the menu is often not the same as what it actually costs (by factors of 2 or more, on flat ground with nothing to delete!).  This was happening with elevated way pieces, when placed one at a time.

I feel like this is due to duplicated code somewhere which needs to be broken out using the "once and only once" principle of coding where you never code the same computation twice.

Also, some types of construction can be done when you're over your credit limit (including elevated way parts construction and deletions... of anything, including city buildings) while others can't, in a seemingly disorderly mishmash.  This also needs to be rationalized somehow, and it's probably also due to duplicated code (the "is it too much for the credit limit" should be checked in one place and only one place, and if the code has to be restructured to do that, it should be).  The few things which can be done when over the credit limit should have some sort of special flag associated with them