Fix bug when using commando from server console

This commit is contained in:
walterhiggins 2013-12-29 13:26:21 +00:00
parent 4b85500257
commit dbf6adfadc

View file

@ -88,13 +88,13 @@ events.on('player.PlayerCommandPreprocessEvent', function(l,e){
var msg = "" + e.message;
var command = msg.match(/^\/([^\s]+)/)[1];
if (commands[command]){
e.message = "/jsp " + msg.substring(1);
e.message = "/jsp " + msg.replace(/^\//,"");
}
});
events.on('server.ServerCommandEvent', function(l,e){
var msg = "" + e.command;
var command = msg.match(/^\/*([^\s]+)/)[1];
if (commands[command]){
e.command = "/jsp " + msg.substring(1);
e.command = "jsp " + msg.replace(/^\//,"");
}
});