The International Simutrans Forum

Development => Patches & Projects => Incorporated Patches and Solved Bug Reports => Topic started by: jamespetts on June 15, 2009, 11:40:00 pm

Title: [Bug] 581 shows map editing tools when not in public player mode
Post by: jamespetts on June 15, 2009, 11:40:00 pm
In earlier versions of Pak128, the map editing tools icon was hidden when the player was not in public player mode; now, it is always visible, but is only usable in public player mode: in other modes, clicking on it produces no result. This is confusing for players, I think, because it is not immediately clear why clicking on a menu icon should have no effect.
Title: Re: [Bug] 581 shows map editing tools when not in public player mode
Post by: VS on June 16, 2009, 11:31:44 am
It's a program bug, not pakset. There were no changes at all to menuconf.tab since late February. 102.0 loads my last working copy (593) without this button, program working copy (2521) with it.

Edit: moved.

Edit2: for the interested - it might be that current code skips the get_icon function in toolbar_t and instead uses the one defined in wkz_???. Not sure if it's true or why, yet.

Edit3: OK, got it. the virtual-ising stopped to work because const qualifier was added for get_icon in wkz_something (in his underground patch) and signature in toolbar_t didn't match anymore, so bye bye virtual. All the rest depended on getting empty icon from that function, so hiding it broke. Adding const to toolbar_t version of get_icon fixed this, but I have absolutely no clue why it should be there (or not), so... test :)

http://vs.simutrans.com/misc_files/edittools-2522.patch
Title: Re: [Bug] 581 shows map editing tools when not in public player mode
Post by: Dwachs on June 16, 2009, 12:42:14 pm
thank you. fixed in 2523. get_icon was declared const in werkzeug_t but not in toolbar_t, which means the toolbar_t geticon-routine was no inheritant (?) of the routine in werkzeug_t. :P
Title: Re: [Bug] 581 shows map editing tools when not in public player mode
Post by: VS on June 16, 2009, 01:08:30 pm
Awwwww, I didn't refresh this page and had to find it myself ;D
Title: Re: [Bug] 581 shows map editing tools when not in public player mode
Post by: Dwachs on June 16, 2009, 02:17:53 pm
The same here, refreshing to see your edit2 would have save me some minutes, too :)
Title: Re: [Bug] 581 shows map editing tools when not in public player mode
Post by: VS on June 16, 2009, 02:47:06 pm
In my defense, first I had to read a book to understand the exact rules for virtual in C++ :)

Funny... in the past I was concerned that the only person hunting bugs will be prissi. Interesting how times change!