
Unable to exterminate TARDIS if any logged out players are inside
Closed this issue ยท 2 comments
This isn't really a bug, but since players are not removed from the travellers
table when logging out, the owner of a TARDIS will never be able to exterminate it if anyone has logged out inside it.
I understand why this restriction exists, and I think this behavior is fine. However, there might be a better way to handle this situation. It would be unfortunate for a player to require admin intervention to delete their TARDIS because someone is logged out inside it.
My proposed solution is to exterminate the TARDIS anyways, but do not remove the entries for the offline players from the travellers
table. Then, we add a listener for player joins and check the following:
- Is the player in the travellers table?
- Does their entry belong to a TARDIS that no longer exists?
If true, teleport them somewhere safe in the same tick that they logged in (bed home, server spawn, etc.)
This should prevent any problems with players falling into the void, etc. when logging into a TARDIS that has been removed.
Tested changes from 16d2e3f, and the traveler isn't getting teleported out when logging back in. I checked, and the row from the travellers
table is being removed when the TARDIS is deleted, likely due to this function which gets called during extermination:
However, even after manually re-adding the row to the travellers table after the TARDIS is deleted, they still aren't being teleported. Will test more tomorrow.