Skip to content

slice off backpack items if char has no backpack#2

Open
tischepe wants to merge 1 commit intothestdman:masterfrom
tischepe:backpackfix
Open

slice off backpack items if char has no backpack#2
tischepe wants to merge 1 commit intothestdman:masterfrom
tischepe:backpackfix

Conversation

@tischepe
Copy link

I've noticed that the backpack empty space count is not always correct,
The rotmg server returns this:
<Char id="***">
<ObjectType>782</ObjectType>
<Level>20</Level>
<Exp>154063</Exp>
<CurrentFame>261</CurrentFame>
<Equipment>2719,2774,2656,2755,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1</Equipment>
... snip ...
<HasBackpack>0</HasBackpack>
</Char>
The character has no backpack, yet equipment contains 19 items, these 7 nonexistent empty spaces get counted in totals.

So I slice the array if the char has no backpack before pushing it into items.

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.

1 participant

Comments