Closed hube12 closed 2 years ago
I think I see the issue, will go try to reproduce
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?
@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.
@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.
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.
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