Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Strange behavior when dragging&dropping from MTG creative inventory (since #13146) #13961

Open
grorp opened this issue Nov 6, 2023 · 3 comments · May be fixed by #14656
Open

Strange behavior when dragging&dropping from MTG creative inventory (since #13146) #13961

grorp opened this issue Nov 6, 2023 · 3 comments · May be fixed by #14656
Labels
Bug Issues that were confirmed to be a bug @ Client / Controls / Input Formspec Regression Something that used to work no longer does.
Milestone

Comments

@grorp
Copy link
Member

grorp commented Nov 6, 2023

Minetest version

Probably all versions since 252c79d (#13146)

Minetest 5.8.0-dev-252c79d53a (Linux)
Using Irrlicht 1.9.0mt11
Using LuaJIT 2.1.0-beta3
BUILD_TYPE=RelWithDebInfo
RUN_IN_PLACE=1
USE_CURL=1
USE_GETTEXT=1
USE_SOUND=1
STATIC_SHAREDIR="."
STATIC_LOCALEDIR="locale"
OS / Hardware

Operating system: Fedora Linux 37 (Workstation Edition)

Summary

I found the following issue that might be worth having a look into:

  1. Use the MTG infinite source creative inventory
  2. Drag & drop an ItemStack from the creative inventory onto another ItemStack of identical types
  3. The ItemStack count combines but the dragged ItemStack is not released
  4. When tapping again into any other empty or ItemStack of identical types, another copy is taken from the creative inventory.
    Expected: release the dragged ItemStack when releasing the finger press.

Originally posted by @SmallJoker in #13872 (comment)

This happens on desktop as well and seems to be a regression from 252c79d.

Video of the problem (252c79d)

Also notice that the size of the held itemstack increases beyond the maximum stack size when I move over multiple slots while dragging&dropping.

strange.creative.inventory.behavior.mp4
Video of the correct behavior (23f7aab)
correct.creative.inventory.behavior.mp4
Steps to reproduce

See the quote from SmallJoker above.

@grorp grorp added Bug Issues that were confirmed to be a bug @ Client / Controls / Input Formspec Regression Something that used to work no longer does. labels Nov 6, 2023
@grorp grorp added this to the 5.8.0 milestone Nov 6, 2023
@rubenwardy
Copy link
Member

Is anyone working on this / any progress?

@grorp grorp modified the milestones: 5.8.0, 5.9.0 Nov 30, 2023
@grorp
Copy link
Member Author

grorp commented Feb 19, 2024

Hey @OgelGames, any chance you could take a look at this?

@sfence
Copy link
Contributor

sfence commented May 13, 2024

Look like a server-side reaction to client code

m_selected_amount += pickup_amount;
infostream << "Handing IAction::Move to manager" << std::endl;
IMoveAction *a = new IMoveAction();
a->count = pickup_amount;
a->from_inv = s.inventoryloc;
a->from_list = s.listname;
a->from_i = s.i;
a->to_inv = m_selected_item->inventoryloc;
a->to_list = m_selected_item->listname;
a->to_i = m_selected_item->i;
m_invmgr->inventoryAction(a);

where is not expected that the server can completely disallow move based on Lua callback return values:

INFO[Server]: IMoveAction::apply(): move was completely disallowed: move_count=3 from inv="player:singleplayer" list="main" i=3 to inv="detached:creative_singleplayer" list="main" i=27

/* If no items will be moved, don't go further */
if (move_count == 0) {
// Undo client prediction. See 'clientApply'
if (from_inv.type == InventoryLocation::PLAYER)
list_from->setModified();
if (to_inv.type == InventoryLocation::PLAYER)
list_to->setModified();
infostream<<"IMoveAction::apply(): move was completely disallowed:"
<<" move_count="<<old_move_count
<<" from inv=\""<<from_inv.dump()<<"\""
<<" list=\""<<from_list<<"\""
<<" i="<<from_i
<<" to inv=\""<<to_inv.dump()<<"\""
<<" list=\""<<to_list<<"\""
<<" i="<<to_i
<<std::endl;
return;
}

sfence added a commit to sfence/minetest that referenced this issue May 14, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug Issues that were confirmed to be a bug @ Client / Controls / Input Formspec Regression Something that used to work no longer does.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants