fix bus busy bug

This commit is contained in:
Olivier Gagnon 2024-06-09 13:28:52 -04:00
parent 5f2efd94e5
commit bdf3a53151
No known key found for this signature in database
GPG Key ID: 0018772EA86FA03F

@ -77,13 +77,13 @@ export function NetscriptMyrian(): InternalAPI<IMyrian> {
bus.busy = true; bus.busy = true;
return helpers.netscriptDelay(ctx, moveSpeed(bus.moveLvl), true).then(() => { return helpers.netscriptDelay(ctx, moveSpeed(bus.moveLvl), true).then(() => {
bus.busy = false;
if (findDevice([x, y])) { if (findDevice([x, y])) {
helpers.log(ctx, () => `[${x}, ${y}] is occupied`); helpers.log(ctx, () => `[${x}, ${y}] is occupied`);
return Promise.resolve(false); return Promise.resolve(false);
} }
bus.x = x; bus.x = x;
bus.y = y; bus.y = y;
bus.busy = false;
return Promise.resolve(true); return Promise.resolve(true);
}); });
}, },