fix(mover): 🐛 attempt to fix move while riding vehicle

This never worked previously.
Using one of `-1 0 1` instead of a larger number appears to work.
This commit is contained in:
jay 2021-04-07 06:42:11 +05:00
parent 8e854a0a2f
commit 4b3e58ceb3

View File

@ -166,7 +166,8 @@ function ride(entity) {
function moveOrRide(turn = false, reverse = -1, directionLabel, message_parts2) {
// bot.once("attach", state = "vehiccel")
if (bot.vehicle) {
const amount = parseInt(message_parts2[0]) || 10 * -reverse
// FIXME moveVehicle should be +-1 or 0?
const amount = Math.sign(parseInt(message_parts2[0]) || -reverse)
bot.moveVehicle(turn && amount || 0, !turn && amount || 0)
} else {
command([directionLabel].concat(message_parts2))