mirror of
https://github.com/danbulant/flying-squid
synced 2026-06-10 18:14:13 +00:00
Small fixes to commands/tp
This commit is contained in:
parent
e49daf1fcd
commit
aeb5f888df
3 changed files with 3 additions and 5 deletions
|
|
@ -37,9 +37,7 @@ class Command {
|
|||
}
|
||||
}
|
||||
|
||||
var val = res[0].params.action(res[1])
|
||||
if (val && val.catch) res = await val.catch((err)=> setTimeout(() => {throw err;},0));
|
||||
else res = val;
|
||||
res = await com.params.action(pars);
|
||||
|
||||
if(res) return '' + res;
|
||||
} else {
|
||||
|
|
|
|||
|
|
@ -117,7 +117,7 @@ module.exports.player=function(player, serv) {
|
|||
if (res) player.chat(serv.color.red + res);
|
||||
}
|
||||
catch(err) {
|
||||
if (err instanceof UserError) player.chat('Error: ' + err.message);
|
||||
if (err instanceof UserError) player.chat(serv.color.red + 'Error: ' + err.message);
|
||||
else setTimeout(() => {throw err;}, 0);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -16,7 +16,7 @@ module.exports.player = (player, serv) => {
|
|||
if(args.length === 2) {
|
||||
let entities_from = player.selectorString(args[0]);
|
||||
let entity_to = player.selectorString(args[1]);
|
||||
if(entity_to.length==0) throw new UserError("at least one target");
|
||||
if(entity_to.length==0) throw new UserError('Invalid target');
|
||||
entity_to = entity_to[0];
|
||||
|
||||
entities_from.forEach(e => e.teleport(entity_to.position.scaled(1/32)));
|
||||
|
|
|
|||
Loading…
Reference in a new issue