The International Simutrans Forum

Development => Patches & Projects => Incorporated Patches and Solved Bug Reports => Topic started by: z9999 on May 11, 2009, 03:03:41 pm

Title: r2455- Minor cursor problem
Post by: z9999 on May 11, 2009, 03:03:41 pm
r2455 GDI

Very minor problem.
When I start simutrans and mouseover on city buildings, city buildings were highlighted.
If I change to underground mode and back to normal mode, this problem will be solved.
Title: Re: r2455- Minor cursor problem
Post by: Dwachs on May 11, 2009, 06:57:10 pm
this patch fixes this:
Code: [Select]
Index: simmain.cc
===================================================================
--- simmain.cc (revision 2456)
+++ simmain.cc (working copy)
@@ -772,6 +772,7 @@
  welt->step_month(5);
  welt->step();
  welt->step();
+ welt->update_map();
  umgebung_t::autosave = old_autosave;
  }
  else {
but I have no idea why this error occurs at all (the grounds below houses have no image set). It happens only if simutrans generates a new map to start with.
Title: Re: r2455- Minor cursor problem
Post by: z9999 on May 12, 2009, 07:58:39 am
Thank you. But unfortunately this patch doesn't solve the problem.
After starting a new game, it suddenly happned again.

How to reproduce;
1. Start a new game
2. Click fast-forward button
3. Wait some month
4. Mouseover on cityhall or factory or attraction

[EDIT]
It also happened with station building and city building.
But it didn't happen with all buildings, but with limited buildings.

In the case of my pak96.comic game, only 2 kind of buildings were highlited.
Title: Re: r2455- Minor cursor problem
Post by: Dwachs on May 12, 2009, 08:57:43 am
Now I found the reason for this bug: this happens to all buildings that do not need ground tiles (ie buildings that cover the whole tile) after change of seasons. Then the ground has no image to reduce overhead for the drawing stuff.
New try to patch this:
Code: [Select]
Index: simview.cc
===================================================================
--- simview.cc  (revision 2456)
+++ simview.cc  (working copy)
@@ -186,9 +186,12 @@
                if(gr && gr->is_visible()) {
                        const PLAYER_COLOR_VAL transparent = TRANSPARENT25_FLAG|OUTLINE_FLAG| umgebung_t::cursor_overlay_color;
                        if(  gr->get_bild()==IMG_LEER  ) {
-                               if(  gr->obj_bei(0)  ) {
+                               if(  gr->hat_wege()  ) {
                                        display_img_blend( gr->obj_bei(0)->get_bild(), x, y, transparent, 0, true );
                                }
+                               else {
+                                       display_img_blend( grund_besch_t::get_ground_tile(0,gr->get_hoehe()), x, y, transparent, 0, true );
+                               }
                        }
                        else {
                                display_img_blend( gr->get_bild(), x, y, transparent, 0, true );

Title: Re: r2455- Minor cursor problem
Post by: Dwachs on May 12, 2009, 05:57:19 pm
should work with rev 2457