Skip to content

Mechomancer patch 1 #526

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

Merged
merged 5 commits into from
May 29, 2024
Merged

Conversation

Mechomancer
Copy link
Contributor

Description

This fixes a multiple drops issue i discovered as it never deletes the drop when empty. this allows you to also pick up an empty drop and then another leaving the first one stuck to the player. So now it also catches if your already carrying a bag you can not pick up another one till you drop the current one.

Checklist

  • I have personally loaded this code into an updated qbcore project and checked all of its functionality.
  • My code fits the style guidelines.
  • My PR fits the contribution guidelines.

This code was added to check the drop for items if no items this removes the bag drop from the world 
Adding more code on client side so your unable to pick up more than one drop at a time. Avoids getting a drop with or without items stuck to you by picking up another.
This was added as part of the multi drop holding conundrum and to ensure there can only be one drop held at a time by the player. 
When drop has no items it's deleted this also removes the target on the bag before it's deleted.
server/main.lua Outdated
@@ -159,6 +159,13 @@ RegisterNetEvent('qb-inventory:server:closeInventory', function(inventory)
end
if Drops[inventory] then
Drops[inventory].isOpen = false
if #Drops[inventory].items == 0 and not Drops[inventory].isOpen then -- if no listeed items in the drop on close
TriggerClientEvent('qb-inventory:client:removeDropTarget', Drops[inventory].entityId)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What client is this triggering on?

Mechomancer and others added 2 commits May 29, 2024 09:25
@GhzGarage GhzGarage merged commit ff25d89 into qbcore-framework:main May 29, 2024
1 of 2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants