News:

Simutrans Chat Room
Where cool people of Simutrans can meet up.

r5787 Win pak64 - The program will crash on "UNDO" after remove the power line.

Started by yoyo, June 25, 2012, 01:26:52 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

yoyo

HI!
I found a bug.

steps to crash.
1) make a power line on the ground.
2) remove power line by bulldozer tool.
3) press Z key (undo)

----------------------------------------------------------------
[ simplay.cc ]

  <<< original >>>
    sint64 spieler_t::undo()
    {
      ...
      leitung_t* lt = gr->get_leitung();
      cost += lt->get_besch()->get_preis();
      ...
    }

  <<< my first aid >>>
    sint64 spieler_t::undo()
    {
      ...
      leitung_t* lt = gr->get_leitung();

      if(!lt) continue; // add NULL check.

      cost += lt->get_besch()->get_preis();
      ...
    }

----------------------------------------------------------------
[ environment ]
os            : Windows7 x64
compiler   : Visual C/C++2010 express
simutrans : r5787 / GDI / Win32 Debug / compiled from source code.
pak          : pak64 111.3 / SVN / makeobj=53
libs          : zlib 1.2.7 / libpng 1.5.11 / bzip2 1.0.6
----------------------------------------------------------------

Thank you!

Dwachs

Parsley, sage, rosemary, and maggikraut.