OpenClonk Bugtracker - OpenClonk
View Issue Details
0001590OpenClonkObjectspublic2016-01-11 18:422017-06-20 13:20
ReporterMaikel 
Assigned ToClonkonaut 
PrioritynormalSeveritymajorReproducibilityalways
StatusresolvedResolutionfixed 
PlatformOSOS Version
Product Version 
Target VersionFixed in Version 
Summary0001590: Can't finish shooting when riding
DescriptionCurrently the only object you can ride is the balloon. Use the balloon and take the bow and try to shoot an arrow. This will fail because its use is cancelled when the mouse button is released. The control libraries do not handle this correctly as it should be a stop call to the the object ridden and then a stop call to the object used by the rider.
TagsNo tags attached.
Attached Files

Notes
(0004874)
Maikel   
2016-01-24 18:53   
A hotfix could be this:


@@ -871,7 +871,7 @@ func ControlUse2Script(int ctrl, int x, int y, int strength, bool repeat, bool r
         {
             return StartUseControl(ctrl,x, y, obj);
         }
- else if (release && obj == this.control.current_object)
+ else if (release && (obj == this.control.current_object || obj == GetActionTarget()))
         {
             return StopUseControl(x, y, obj);
         }
@@ -883,7 +883,7 @@ func ControlUse2Script(int ctrl, int x, int y, int strength, bool repeat, bool r
         {
             return StartUseDelayedControl(ctrl, obj);
         }
- else if (release && obj == this.control.current_object)
+ else if (release && (obj == this.control.current_object || obj == GetActionTarget()))
         {
             return StopUseDelayedControl(obj);
         }
(0005056)
occ   
2016-04-17 13:13   
Hi! There's been a check-in that references this bug. For more information you can visit the repository browser at this address:
https://git.openclonk.org/openclonk.git/commitdiff/b7a8b3067f34c54edeb3c2e0527fab7aeacf6da5

Changeset b7a8b30 by Maikel de Vries <mdt.maikel@gmail.com>
correctly stop use control when clonk is attached (0001590)

(0005057)
Maikel   
2016-04-17 13:16   
I added this hotfix, a real solution is still needed of course.
(0005078)
Clonkonaut   
2016-04-25 08:34   
I wanted to fix riding & shooting anyway for ridable lorries.

What would be your preferred behaviour with the balloon? Can you shoot from it yay/nay?
(0005081)
Maikel   
2016-04-25 13:54   
Yes, you should be able to shoot from it. Combinations are cool.
(0005082)
Clonkonaut   
2016-04-26 19:27   
Well, I don't see the real problem with your hotfix. Current behaviour is as intended (I'd guess):
You get Start/Stop calls for the ridden object. If not handled, the currently selected item is called instead.
(0005083)
Maikel   
2016-04-26 19:39   
I fixed the problem, yes, but I did not test extensively and I did not understand fully why this fixes the problem.

If you say this is a complete fix we can close the report I guess.
(0005086)
Clonkonaut   
2016-05-01 09:47   
I gave this some thought and came to the conclusion to close it.
It may not be the best solution but not the worst either. I don't feel like adding another variable to the controls library to keep track of the vehicle (in addition to the selected item).

There is only one bad thing though. If a vehicle return true in ControlUseStop the item doesn't receive a stop callback. While I think this is wrong usage of the interface, we might want to do something about. I just don't know what yet.

Issue History
2016-01-11 18:42MaikelNew Issue
2016-01-24 18:53MaikelNote Added: 0004874
2016-01-24 18:53MaikelAssigned To => Zapper
2016-01-24 18:53MaikelStatusnew => assigned
2016-01-29 16:27ZapperStatusassigned => new
2016-01-29 16:30ZapperAssigned ToZapper =>
2016-04-17 13:13occNote Added: 0005056
2016-04-17 13:16MaikelNote Added: 0005057
2016-04-25 08:34ClonkonautNote Added: 0005078
2016-04-25 08:34ClonkonautAssigned To => Clonkonaut
2016-04-25 08:34ClonkonautStatusnew => confirmed
2016-04-25 08:35ClonkonautStatusconfirmed => assigned
2016-04-25 13:54MaikelNote Added: 0005081
2016-04-26 19:27ClonkonautNote Added: 0005082
2016-04-26 19:27ClonkonautStatusassigned => feedback
2016-04-26 19:39MaikelNote Added: 0005083
2016-04-26 19:39MaikelStatusfeedback => assigned
2016-05-01 09:47ClonkonautNote Added: 0005086
2016-05-01 09:47ClonkonautStatusassigned => resolved
2016-05-01 09:47ClonkonautResolutionopen => fixed