fix(mover): 🐛 fix crash when no mobs nearby while searching for rides

This commit is contained in:
jay 2021-01-28 01:28:37 +05:00
parent 6b1157147d
commit fc43985337

View File

@ -89,7 +89,7 @@ function ride(entity) {
const maybeRidableMob = e.mobType?.split(" ") const maybeRidableMob = e.mobType?.split(" ")
return e.kind == "Vehicles" return e.kind == "Vehicles"
|| ridableMobs.includes(e.mobType) || ridableMobs.includes(e.mobType)
|| ridableMobs.includes(maybeRidableMob[maybeRidableMob.length - 1]) || maybeRidableMob && ridableMobs.includes(maybeRidableMob[maybeRidableMob.length - 1])
}) })
if (!vehicle) { if (!vehicle) {
return cfg.quiet || bot.chat(`Nothing to ${message_parts[0]}`) return cfg.quiet || bot.chat(`Nothing to ${message_parts[0]}`)