Support named function in lieu of command name as first argument

This commit is contained in:
walterhiggins 2014-06-14 15:38:41 +01:00
parent 4d97452b15
commit 918ef23773

View file

@ -42,6 +42,14 @@ var executeCmd = function( args, player ) {
define a new JSP command. define a new JSP command.
*/ */
var defineCmd = function( name, func, options, intercepts ) { var defineCmd = function( name, func, options, intercepts ) {
if ( typeof name == 'function'){
intercepts = options;
options = func;
func = name;
name = func.name;
}
if ( typeof options == 'undefined' ) { if ( typeof options == 'undefined' ) {
options = []; options = [];
} }