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

Running current commit failed when having 2 players in a world #58

Closed
hube12 opened this issue Jan 18, 2022 · 6 comments · Fixed by #59
Closed

Running current commit failed when having 2 players in a world #58

hube12 opened this issue Jan 18, 2022 · 6 comments · Fixed by #59

Comments

@hube12
Copy link

hube12 commented Jan 18, 2022

022-01-18 23:43:23][mchprs::server][ERROR] plot panicked at 'index out of bounds: the len is 1 but the index is 1', src/plot/mod.rs:999:28

@EwanFox
Copy link
Contributor

EwanFox commented Jan 18, 2022

I think I see the issue, will go try to reproduce

EwanFox added a commit to EwanFox/MCHPRS that referenced this issue Jan 19, 2022
@StackDoubleFlow
Copy link
Member

There should be another error which causes the Drop implementation of Plot to run while there are still players in it just prior to this one. Would you be able to provide a more complete log?

@hube12
Copy link
Author

hube12 commented Jan 19, 2022

@StackDoubleFlow This was the only and sole error before the panic, nothing happened before. We only moved our player in and out of a plot albeit a bit fast but still. I did not have the backtrace full on tho.

@hube12
Copy link
Author

hube12 commented Jan 19, 2022

@BananaSquares Maybe use a if let guard with if let Some(player)= self.players.get(index)

Anyway player should be behind an Arc lock or a mutex. also index-1 would yield -1 for index=0 so probs not the fix.

@StackDoubleFlow
Copy link
Member

StackDoubleFlow commented Jan 19, 2022

Nah that's not going to actually fix that. That needs to be something like while !self.players.is_empty() instead of a for loop there.

@EwanFox
Copy link
Contributor

EwanFox commented Jan 20, 2022

#59 should fix it

StackDoubleFlow pushed a commit that referenced this issue Jan 20, 2022
* fix issue #58

* really fixed it this time
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 a pull request may close this issue.

3 participants