Anonymous Login
2018-01-16 08:38 CET

View Issue Details Jump to Notes ]
IDProjectCategoryView StatusLast Update
0001970OpenClonkObjectspublic2018-01-13 15:24
ReporterMarky 
Assigned ToZapper 
PrioritynormalSeverityminorReproducibilityhave not tried
StatusassignedResolutionopen 
Product Version 
Target VersionFixed in Version 
Summary0001970: Liquid and/or stacked object displays sometimes broken in ObjectInteractionMenu
DescriptionSee http://bugs.openclonk.org/view.php?id=1951

Both of those displays are sometimes broken, see the two attached screenshots. In the first (115), the upper display actually shows four digits (1351), but the one in the description field shows 300/300. The second one (116) shows the "airplane" situation where the upper display stopped at 999 and the lower one shows the correct count.
TagsNo tags attached.
Attached Files

-Relationships
related to 0001951resolvedMarky Making water disappear with an airplane 
related to 0001972resolvedZapper Powder Keg shows overlapping numbers in inventory menu 
+Relationships

-Notes

~0005994

Zapper (developer)

I checked the code and it looks like your implementation in
https://git.openclonk.org/openclonk.git/commit/8698aa25cf7a7e35568e50b084c02cf17e768173
is faulty.

I'll fix it tomorrow or so.

~0006008

occ (reporter)

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/0f049800c5aa712491abc47c415edde4972a52d2

Changeset 0f04980 by David Dormagen <czapper@gmx.de>
Revert "Object Interation Menu: Request displayed amount from objects" (0001970)

This reverts commit 8698aa25cf7a7e35568e50b084c02cf17e768173.

Tackling 0001970. The implementation in the reverted commit was incorrect (i.e. only one out of two "GetStackCount" were replaced with GetInteractionMenuAmount, leading to weird behaviour). If you want to replace it, please do it in a way that no call to IsInfiniteStack will be required. And this hack would probably require so much more bloat code that nothing would be gained (i.e. what happens when you put two infinite arrow stacks in one container?).
The bug report complains about the "display stopping at 999" *in some situations*, which was due to Stackable_Max_Display_Count. It's gone now. And that it was not limited to 999 in all situations (like the code would have suggested) is probably due to the things I described above.

# Conflicts:
# planet/Objects.ocd/Libraries.ocd/LiquidControl.ocd/Liquid.ocd/Script.c
# planet/Objects.ocd/Libraries.ocd/Stackable.ocd/Script.c

~0006010

Zapper (developer)

I can not reproduce the first problem:
"In the first (115), the upper display actually shows four digits (1351), but the one in the description field shows 300/300."

Do you know what can cause this? I tried moving water in and out of a locomotive but it looked good at all times

~0006017

Luchs (developer)

I think your commit broke stack counts for the dynamite box. When looking into the box, it shows the number of dynamite bars squared now, i.e. 25, 16, etc. instead of 5, 4, ...

~0006020

Marky (developer)

That must be caused by the CanBeStackedWith for-loop thingy right below that call.

I think that I left the second GetStackCount out on purpose, because it talked specifically about stacks there. Reverting my commit is no problem - the main idea here was the following: Instead of making tons of special cases (stack count _and_ infinite stacks) for various objects that display amounts in the interaction menu the object should tell the menu as how much it wants to be displayed.
Still, if this was implemented faulty, then it was better to remove that.

Is Stackable_Max_Display_Count actually used anywhere then?

~0006028

Luchs (developer)

@Sven2 fixed the dynamite box issue in https://github.com/openclonk/openclonk/commit/5fc07df7574b22a3d956c22ae1bdfadd4f70fe0f

~0006051

occ (reporter)

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/6b797e300e5b5bc7ddfcfad138cb624e9b4ad5c1

Changeset 6b797e3 by David Dormagen <czapper@gmx.de>
inventory bar: stack count always falls back to contained object count

Related to 0001970 and 5fc07df7574b22a3d956c22ae1bdfadd4f70fe0f
This replaces the very hacky implementation just for the dynamite with a more general solution (and e.g. also works with the grenade launcher).

+Notes

-Issue History
Date Modified Username Field Change
2017-12-29 13:07 Marky New Issue
2017-12-29 13:10 Marky Relationship added related to 0001951
2017-12-29 18:16 Zapper Note Added: 0005994
2017-12-29 18:16 Zapper Assigned To => Zapper
2017-12-29 18:16 Zapper Status new => assigned
2018-01-07 10:07 Marky Relationship added related to 0001972
2018-01-07 17:42 occ Note Added: 0006008
2018-01-07 17:42 occ Note Added: 0006009
2018-01-07 17:43 Zapper Note Added: 0006010
2018-01-07 17:44 Zapper Status assigned => feedback
2018-01-07 17:44 Zapper Note Deleted: 0006009
2018-01-08 11:36 Luchs Note Added: 0006017
2018-01-08 21:07 Marky Note Added: 0006020
2018-01-08 21:07 Marky Status feedback => assigned
2018-01-10 12:09 Luchs Note Added: 0006028
2018-01-13 15:24 occ Note Added: 0006051
+Issue History