[fix] Flight crash in singleplayer (#1565)

Entering a singleplayer world with flight enabled causes this crash.
https://hastebin.com/tufariposu.log
This commit is contained in:
Spider 2020-11-07 21:27:15 -06:00 committed by GitHub
parent 2f2815b15c
commit 64d7552b5a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 2 additions and 1 deletions

View File

@ -47,6 +47,7 @@ object Flight : Module() {
init {
listener<PlayerTravelEvent> {
if (mc.player == null) return@listener
when (mode.value) {
FlightMode.STATIC -> {
mc.player.capabilities.isFlying = false
@ -101,4 +102,4 @@ object Flight : Module() {
if (mode.value == FlightMode.PACKET && it.packet is SPacketCloseWindow) it.cancel()
}
}
}
}