From 45dc08c946b3f78967830e72ef5ffaa5bb4f51cb Mon Sep 17 00:00:00 2001 From: Michael Morrison Date: Wed, 10 Jul 2013 10:52:15 -0500 Subject: [PATCH] Patch warsow --- protocols/quake2.js | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/protocols/quake2.js b/protocols/quake2.js index 19d8d8b..b441f80 100644 --- a/protocols/quake2.js +++ b/protocols/quake2.js @@ -33,12 +33,17 @@ module.exports = require('./core').extend({ var args = []; var split = player.split('"'); var inQuote = false; - for(var i = 0; i < split; i++) { - var part = split[i]; + split.forEach(function(part,i) { var inQuote = (i%2 == 1); - if(inQuote) args.push(part); - else args = args.concat(part.split(' ')); - } + if(inQuote) { + args.push(part); + } else { + var splitSpace = part.split(' '); + splitSpace.forEach(function(subpart) { + if(subpart) args.push(subpart); + }); + } + }); var frags = parseInt(args[0]); var ping = parseInt(args[1]);