You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
group_sel is set when group dragging is started, but not cleared when dragging is aborted
OnDragDrop will execute both a vehicle drag and a group drag if vehicle_sel and group_sel are both set.
OnDragDrop_Group does not check that group_sel is valid before getting the Group* and dereferencing it.
The text was updated successfully, but these errors were encountered:
JGRennison
added a commit
to JGRennison/OpenTTD-patches
that referenced
this issue
Oct 25, 2020
By following the above steps without deleting the group, the actual result is that not only is the vehicle assigned to the selected group, but also the last group hierarchy action that should have been aborted is instead finally completed.
Also, try the following steps:
Have at least two groups and one vehicle.
Start dragging one of the groups.
Press ESC to stop dragging.
Delete the group.
In another vehicle type window, create a new group.
Drag the vehicle onto another existing group of the same vehicle type.
The result is that the 'assign vehicle to group' action succeeds in step 6, but the 'set parent group' action which was initialized in step 2 persists and fails with the error message "Can't set parent group".
…ehicle drag&drop
The selected group was not reset when drag&drop was aborted. When
after that vehicle drag&drop was successful, group drag&drop code
was still executed, causing weird behaviour or even crashes.
Version of OpenTTD
master (since 567d0ff)
Expected result
No null pointer dereferences
Actual result
A null pointer dereference
Steps to reproduce
group_sel is set when group dragging is started, but not cleared when dragging is aborted
OnDragDrop will execute both a vehicle drag and a group drag if vehicle_sel and group_sel are both set.
OnDragDrop_Group does not check that group_sel is valid before getting the Group* and dereferencing it.
The text was updated successfully, but these errors were encountered: