Synchronet now requires the libarchive development package (e.g. libarchive-dev on Debian-based Linux distros, libarchive.org for more info) to build successfully.

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

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
match.
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?');
sln('');
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();
sln('');
for (i = 0; i < pfile.length; i++) {
pl = pfile.get(i);
if (pl.name.indexOf(pn) !== 0) {
haystack = superclean(pl.name).toLowerCase();
if (haystack.indexOf(needle) !== -1) {
lw('\r');
dk.console.cleareol();
lw(' `2You mean `0'+pl.name+'`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