Skip to main content
Topic: r2455- Minor cursor problem (Read 2992 times) previous topic - next topic

r2455- Minor cursor problem

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.

Re: r2455- Minor cursor problem

Reply #1
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.
Parsley, sage, rosemary, and maggikraut.

Re: r2455- Minor cursor problem

Reply #2
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.

 

Re: r2455- Minor cursor problem

Reply #3
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 );

Parsley, sage, rosemary, and maggikraut.

Re: r2455- Minor cursor problem

Reply #4
should work with rev 2457
Parsley, sage, rosemary, and maggikraut.