News:

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

Uninitialised destruction

Started by jamespetts, September 02, 2015, 04:30:40 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

jamespetts

The new patch to avoid doing unnecessary things when destroying a map is useful, but the variable "destroy" is uninitialised when the map is created, which causes all sorts of problems. Adding destroy = false; to the constructor for karte_t solves these problems.
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.

kierongreen


Dwachs

thank you both! I totally missed that.
Parsley, sage, rosemary, and maggikraut.

kierongreen

Is karte_t actually reused? If not we don't need to set destroying back to false at the end of destroy().

prissi

karte_t was reused everytime you load/create a game and never ever really freed. Or rather destroy is called before loading/creating a map. So it exists for eternity. Hence there was once a patch to remove it completely.