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

Inventory space not calculated right? #151

Open
NickCloudAT opened this issue Nov 22, 2020 · 2 comments
Open

Inventory space not calculated right? #151

NickCloudAT opened this issue Nov 22, 2020 · 2 comments

Comments

@NickCloudAT
Copy link

NickCloudAT commented Nov 22, 2020

Currently this methode is used to calculate if a player has free Inventory space:

function Player:PS2_HasInventorySpace( slots )
	if not self.PS2_Inventory then
		error( "Inventory of " .. tostring( self ) .. " not cached" )
	end

	local slotsUsed = table.Count( self.PS2_Inventory:getItems() )
	local slotsTotal = self.PS2_Inventory:getNumSlots( )
	return slotsTotal - slotsUsed - slots >= 0
end

But I would say this is flawed, as it just counts all items you have and checks it to the max amount of slots you have.. But some Items stack and so you have free slots left, but the Shop says you are full.

@Dimentio
Copy link
Collaborator

That's because the item stacking is purely visual

@NickCloudAT
Copy link
Author

That's because the item stacking is purely visual

Hm okay.. But that is pretty confusing for players.. But well

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

No branches or pull requests

2 participants