EngineHub / CommandBook

General and administrative commands
https://enginehub.org/commandbook/
GNU Lesser General Public License v3.0
145 stars 105 forks source link

Make sure the world is still loaded when popping from the location history #114

Closed killme closed 6 years ago

me4502 commented 6 years ago

Is there no better way to ensure a world is loaded? And has this been tested?

DarkArc commented 6 years ago

Additionally, it should probably go on to the next location, as there can be multiple locations in the history.

killme commented 6 years ago

Is there no better way to ensure a world is loaded? Not that I am aware of. The world object does not expose anything like Entity#isValid.

Additionally, it should probably go on to the next location, as there can be multiple locations in the history. Will do.

This change seems to work just fine on my staging server. (Apart from the requested change)

me4502 commented 6 years ago

I originally said not to just go to the next one, as that’s probably not what’s wanted.

Eg, if a player dies and uses it to go back, they don’t want it to take them to the prior location if the world is now unloaded.

killme commented 6 years ago

Would you want it to report a special message in the case the world is unloaded? Because than I will need to make a few more changes.

killme commented 6 years ago

Made it non-looping.

me4502 commented 6 years ago

If there is no location, just make it say the location is unavailable etc. What does it currently do?

killme commented 6 years ago

It just says something along the lines of "no more locations available". I could modify the command to peek if the next location will be valid.