Skip to content
Snippets Groups Projects
Commit 87bbc1e9 authored by Deucе's avatar Deucе :ok_hand_tone4:
Browse files

More svar fixes, and fix &money and &gold in hard-coded strings.

parent 1d472da3
No related branches found
No related tags found
1 merge request!463MRC mods by Codefenix (2024-10-20)
...@@ -1292,7 +1292,10 @@ function getsvar(args, offset, vname) ...@@ -1292,7 +1292,10 @@ function getsvar(args, offset, vname)
if (typeof fv === 'string') { if (typeof fv === 'string') {
if (typeof v !== 'string') if (typeof v !== 'string')
return replace_vars(args.splice(offset - 1).join(' ')); return replace_vars(args.slice(offset).join(' '));
// TODO: Not really sure how variable replacements with spces work.
// DAMN YOU SETH!!!
args[offset] = v;
return replace_vars(args.slice(offset).join(' ')); return replace_vars(args.slice(offset).join(' '));
} }
return v; return v;
......
...@@ -484,7 +484,7 @@ function insane_run_ref(sec, fname, refret) ...@@ -484,7 +484,7 @@ function insane_run_ref(sec, fname, refret)
if (args.length > 1) { if (args.length > 1) {
// Note that this seems to be the only place NIL is actually documented *sigh* // Note that this seems to be the only place NIL is actually documented *sigh*
val = replace_vars(args[1]); val = replace_vars(args[1]);
if (val.toLowerCase() === 'nil') if (typeof val === 'string' && val.toLowerCase() === 'nil')
val = ''; val = '';
if (args.length > 2) { if (args.length > 2) {
svar = args[2]; svar = args[2];
...@@ -742,7 +742,7 @@ function insane_run_ref(sec, fname, refret) ...@@ -742,7 +742,7 @@ function insane_run_ref(sec, fname, refret)
dk.console.gotoxy(0, 23); dk.console.gotoxy(0, 23);
lw('`r5 '); lw('`r5 ');
dk.console.gotoxy(2, 23); dk.console.gotoxy(2, 23);
lw('`$Q `2to quit, `$ENTER `2to buy item. You have `$&gold `2gold.`r0'); lw('`$Q `2to quit, `$ENTER `2to buy item. You have `$'+pretty_int(player.money)+' `2gold.`r0');
if (items.length === 0) { if (items.length === 0) {
dk.console.gotoxy(0, 10); dk.console.gotoxy(0, 10);
...@@ -777,7 +777,7 @@ function insane_run_ref(sec, fname, refret) ...@@ -777,7 +777,7 @@ function insane_run_ref(sec, fname, refret)
dk.console.gotoxy(0, 23); dk.console.gotoxy(0, 23);
lw('`r5 '); lw('`r5 ');
dk.console.gotoxy(2, 23); dk.console.gotoxy(2, 23);
lw('`$Q `2to quit, `$ENTER `2to buy item. You have `$&gold `2gold.`r0'); lw('`$Q `2to quit, `$ENTER `2to buy item. You have `$'+pretty_int(player.money)+' `2gold.`r0');
break; break;
} }
} }
...@@ -1387,7 +1387,7 @@ function insane_run_ref(sec, fname, refret) ...@@ -1387,7 +1387,7 @@ function insane_run_ref(sec, fname, refret)
tmp = getvar(args[++tmp2]).length; tmp = getvar(args[++tmp2]).length;
} }
else else
tmp = getsvar1(args, tmp2, args[0]); tmp = getsvar1(args[tmp2], args[0]);
tmp2++; tmp2++;
if (getvar(args[0]).toString().toLowerCase() === tmp.toString().toLowerCase()) if (getvar(args[0]).toString().toLowerCase() === tmp.toString().toLowerCase())
handlers.do(args.slice(tmp2 + 1)); handlers.do(args.slice(tmp2 + 1));
...@@ -1654,7 +1654,7 @@ function insane_run_ref(sec, fname, refret) ...@@ -1654,7 +1654,7 @@ function insane_run_ref(sec, fname, refret)
rescan: rescan:
while (1) { while (1) {
dk.console.gotoxy(39, 23); dk.console.gotoxy(39, 23);
lw('`2`r5You have `$&money `2gold.`r0'); lw('`2`r5You have `$'+pretty_int(player.money)+' `2gold.`r0');
inv = get_inventory(); inv = get_inventory();
if (inv.length === 0) { if (inv.length === 0) {
dk.console.gotoxy(0, 6); dk.console.gotoxy(0, 6);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment