Commit 11046a5e authored by Deucе's avatar Deucе 👌🏾
Browse files

Fix chooseplayer() function

Previously, it did a case sensitive match against names that started
with what you typed including LORD codes.

Now it strips codes from both and does a case-insentive substring
parent 9d6b6c2f
......@@ -1491,19 +1491,21 @@ function chooseplayer()
var i;
var pl;
var pn;
var needle;
var haystack;
var ch;
lln('`r0`2 Who would you like to send a message to?');
lln(' `2(`0full or `%PARTIAL`0 name`2).')
lw(' `2NAME `8: `%');
pn = superclean(dk.console.getstr({len:26}));
needle = superclean(dk.console.getstr({len:26})).toLowerCase();
for (i = 0; i < pfile.length; i++) {
pl = pfile.get(i);
if ( !== 0) {
haystack = superclean(;
if (haystack.indexOf(needle) !== -1) {
lw(' `2You mean `0''`2? [`0Y`2] `8: ');
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment