The International Simutrans Forum

Development => Patches & Projects => Incorporated Patches and Solved Bug Reports => Topic started by: captain crunch on January 15, 2018, 12:48:01 AM

Title: Remove Way - No preview when dragging
Post by: captain crunch on January 15, 2018, 12:48:01 AM
When dragging the tool to remove ways it used to show you which way would get removed by displaying the remove icon (X) along the way. Now it is not shown, turning this action into a game of chance. This behaviour probably changed around svn commit r8336.
Title: Re: Remove Way - No preview when dragging
Post by: Leartin on January 15, 2018, 05:51:33 AM
That "Remove Icon" is just a copy of the cursor. I don't see the cursor on your second screen - could it be that there simply is no cursor defined in the pakset, hence no graphic for the game to show?

EDIT: It's not pakset specific, the cursor is gone for other paksets as well.
Title: Re: Remove Way - No preview when dragging
Post by: Dwachs on January 15, 2018, 07:34:44 AM
Which version works? Which does not? Cannot think of any change that caused this.
Title: Re: Remove Way - No preview when dragging
Post by: Leartin on January 15, 2018, 08:27:02 AM
Since it affects the cursors of multiple tools (place label, plant tree etc.) perhaps it's an oversight in userfriendlys patch which operates in that area of the code?
Title: Re: Remove Way - No preview when dragging
Post by: userfriendly on January 15, 2018, 09:29:26 PM
Leartin is correct. The version after https://github.com/aburch/simutrans/commit/85deb996b3170453c511d1a834e1379c711a471d has the bug and the version right before my changes does not have the bug :(

I'll look into this, sometime this week, since it doesn't seem to be a game breaking bug.
Title: Re: Remove Way - No preview when dragging
Post by: ROCAMBOLER529 on January 16, 2018, 12:33:50 AM
Maybe the road cannot be connnected in totally... In the irregulars terrains its very difficult to see if the road is connected or its has an end point!!
Title: Re: Remove Way - No preview when dragging
Post by: Dwachs on January 16, 2018, 07:40:38 AM
@userfriendly: Solution should be simple: first copy data the old way (before your patch), then call the method of your patch

*addtool = *(general_tool[toolnr]); // this line was removed by the commit, bringing it back could help?
set_defaults_general_tool(addtool, param_str);

Found no time to test whether this would work.
Title: Re: Remove Way - No preview when dragging
Post by: userfriendly on January 16, 2018, 06:30:14 PM
@Dwachs Thanks - I can confirm that fixes the issue! Reverted the line on master and the bug is gone.
I do want to know why that broke the remove ways icons. Any ideas?
Title: Re: Remove Way - No preview when dragging
Post by: Dwachs on January 17, 2018, 07:38:46 AM
This missing line copies the data that is now missing: set_defaults_general_tools does only copy data for tools are related to some object, which is not the case for remove ways.
Title: Re: Remove Way - No preview when dragging
Post by: Dwachs on January 17, 2018, 09:00:09 PM
This is now in r8371. Thanks for testing!
Title: Re: Remove Way - No preview when dragging
Post by: captain crunch on January 18, 2018, 12:34:58 PM
Thank you, it works!