News:

Simutrans Wiki Manual
The official on-line manual for Simutrans. Read and contribute.

[assert] factorylist_stats_t.cc:60 assert(max_capacity>0);

Started by PJMack, April 15, 2022, 10:25:37 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

PJMack

Assertion occurs when changing from operation rate to ... what the next item is in the factory dialog.  Difficult to reproduce on a new game.

jamespetts

Quote from: PJMack on April 15, 2022, 10:25:37 PMAssertion occurs when changing from operation rate to ... what the next item is in the factory dialog.  Difficult to reproduce on a new game.

Thank you for the report. Is there any reliable reproduction case for this?
Download Simutrans-Extended.

Want to help with development? See here for things to do for coding, and here for information on how to make graphics/objects.

Follow Simutrans-Extended on Facebook.

PJMack

So far, the issue has only appeared on a specific map (and has consistently appeared on that map).  I have been using the map for testing of other features, however since I did not touch any of the industry code, I do not think it is anything I did.  Unfortunately, the map is far too large to attach.

jamespetts

I do not think that I will feasibly be able to look into this without a reliable reproduction case, I am afraid.
Download Simutrans-Extended.

Want to help with development? See here for things to do for coding, and here for information on how to make graphics/objects.

Follow Simutrans-Extended on Facebook.

PJMack

PR#539 fixes the crash.  It was caused by an apothecary that for some reason has a maximum capacity of zero.

Ranran(retired)

PR#539 appears to be a change that is only intended to avoid crashes by avoiding division by zero.
I don't have a clear way to reproduce that, so I can't confirm it, but I think it will break the display. (Perhaps the bar pops out of the frame because the width is not calculated accurately).

The essence of the problem is that the capacity is not supposed to be zero, yet it is getting zero. I think that for some reason the factory is not getting the data or there is an industry with a capacity of 0 due to an anomaly in the calculation.
If the storage capacity is 0, it means that shipping or consumption cannot be done correctly, so I don't think it would take such a value.

Anyway, I think it would be smarter not to display the bar by changing assert to return and terminating the process.
ひめしという日本人が開発者達の助言を無視して自分好みの機能をextendedに"強引に"実装し、
コードをぐちゃぐちゃにしてメンテナンスを困難にし(とりわけ道路と建物関連)、
挙句にバグを大量に埋め込み、それを知らんぷりして放置し(隠居するなどと言って)別のところに逃げ隠れて自分のフォーク(OTRP)は開発を続けている
その事実と彼の無責任さに日本人プレイヤーは目を向けるべき。らんらんはそれでやる気をなくした(´・ω・`)
他人の振り見て我が振り直せ。ひめしのようにならないために、らんらんが生み出したバグや問題は自分で修正しなくちゃね(´・ω・`)