SmallJoker / boost_cart

The original version of minetest_game's carts (since 2018).
15 stars 14 forks source link

Make player reattach to cart after reentering the game. #25

Closed v-rob closed 4 years ago

v-rob commented 6 years ago

This pull request makes it so that players reattach to the cart they were on after reentering the game. If a player leaves the game, other players can then get onto that cart, and if the original player in the cart reconnects, he will not reattach to that cart since there is already a player in it.

SmallJoker commented 6 years ago

Thanks for your PR. This idea sounds good on the paper, but might not always work as intended. Imagine the cart continues driving after the player left - some mapblocks later it gets unloaded and also saves its driver. Now it the player re-joins, then the cart is not always loaded at the same time. However, when it does get loaded then the player gets teleported over the entire world (if they happen to be already this far away) to attach to the cart again.

v-rob commented 6 years ago

Hmm. I thought about that, but didn't really consider it very much. Perhaps it could be a setting, since I want to reconnect to my carts in singleplayer. If that sounds fine, then I'll get to coding that (and an improvement to my code that I forgot to add earlier)