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

Fix variable editors, they had an off-by-one.

parent 8ed54713
No related branches found
No related tags found
1 merge request!463MRC mods by Codefenix (2024-10-20)
...@@ -837,14 +837,14 @@ menu('`r0`c `r1 `%LORD II: CONFIGURE JS `r0', true, [ ...@@ -837,14 +837,14 @@ menu('`r0`c `r1 `%LORD II: CONFIGURE JS `r0', true, [
dk.console.cleareol(); dk.console.cleareol();
ctx.opts = options(); ctx.opts = options();
}}, }},
{text:' `2(`%D`2) Experience : `%'+pretty_int(player.p[0])+'`r0`2', shortcut:'D', callback:function(ctx) { {text:' `2(`%D`2) Experience : `%'+pretty_int(player.experience)+'`r0`2', shortcut:'D', callback:function(ctx) {
dk.console.gotoxy(26, 6); dk.console.gotoxy(26, 6);
conio.setcursortype(2); conio.setcursortype(2);
player.p[0] = parseInt(dk.console.getstr({edit:player.p[0].toString(), crlf:false, input_box:true, select:false, attr:new Attribute(31), len:10, integer:true, min:0, max:2147483647}), 10); player.experience = parseInt(dk.console.getstr({edit:player.experience.toString(), crlf:false, input_box:true, select:false, attr:new Attribute(31), len:10, integer:true, min:0, max:2147483647}), 10);
conio.setcursortype(0); conio.setcursortype(0);
dk.console.gotoxy(26, 6); dk.console.gotoxy(26, 6);
dk.console.attr.value = 2; dk.console.attr.value = 2;
lw(pretty_int(player.p[0])); lw(pretty_int(player.experience));
dk.console.cleareol(); dk.console.cleareol();
ctx.opts = options(); ctx.opts = options();
}}, }},
...@@ -893,9 +893,9 @@ menu('`r0`c `r1 `%LORD II: CONFIGURE JS `r0', true, [ ...@@ -893,9 +893,9 @@ menu('`r0`c `r1 `%LORD II: CONFIGURE JS `r0', true, [
while(1) { while(1) {
lln('`r0`2`c `r1`%Byte variables that are not set to 0...`r0'); lln('`r0`2`c `r1`%Byte variables that are not set to 0...`r0');
sln(''); sln('');
for (i = 0; i < 99; i++) { for (i = 0; i < 100; i++) {
if (varnames.t[i] !== undefined) { if (varnames.t[i] !== undefined) {
lln(' `2Var `0'+space_pad(i.toString(), 2)+'`2 is `%'+space_pad(player.t[i].toString(),10)+'`r0`2(`0'+varnames.t[i]+'`2)'); lln(' `2Var `0'+space_pad(i.toString(), 2)+'`2 is `%'+space_pad(player.t[i-1].toString(),10)+'`r0`2(`0'+varnames.t[i]+'`2)');
} }
} }
sln(''); sln('');
...@@ -929,9 +929,9 @@ menu('`r0`c `r1 `%LORD II: CONFIGURE JS `r0', true, [ ...@@ -929,9 +929,9 @@ menu('`r0`c `r1 `%LORD II: CONFIGURE JS `r0', true, [
while(1) { while(1) {
lln('`r0`2`c `r1`%Long vars being used...`r0'); lln('`r0`2`c `r1`%Long vars being used...`r0');
sln(''); sln('');
for (i = 0; i < 99; i++) { for (i = 0; i < 100; i++) {
if (varnames.p[i] !== undefined) { if (varnames.p[i] !== undefined) {
lln(' `2Var `0'+space_pad(i.toString(), 2)+'`2 is `%'+space_pad(player.p[i].toString(),10)+'`r0`2(`0'+varnames.p[i]+'`2)'); lln(' `2Var `0'+space_pad(i.toString(), 2)+'`2 is `%'+space_pad(player.p[i-1].toString(),10)+'`r0`2(`0'+varnames.p[i]+'`2)');
} }
} }
sln(''); sln('');
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment