SRL Archive - MSI Bugs

problem with banking


Shuttleu

2010-07-22 20:01:46

i have found a problem with the banking
if you have set 2 objects on a script then this happens
12:44:30 AM: Simbatester: Entering Func: MSI_OpenBank: Successfuly opened Varrock east bank
12:44:30 AM: Simbatester: Entering Func: MSI_FindItemSlots: Found 0 Bronze pickaxe in inventory
12:44:30 AM: Simbatester: Entering Func: MSI_FindItemSlots: Found 0 Iron pickaxe in inventory
12:44:30 AM: Simbatester: Entering Func: MSI_FindItemSlots: Found 0 Steel pickaxe in inventory
12:44:30 AM: Simbatester: Entering Func: MSI_FindItemSlots: Found 0 Mithril pickaxe in inventory
12:44:30 AM: Simbatester: Entering Func: MSI_FindItemSlots: Found 0 Adamant pickaxe in inventory
12:44:30 AM: Simbatester: Entering Func: MSI_FindItemSlots: Found 0 Rune pickaxe in inventory
12:44:31 AM: Simbatester: Entering Func: MSI_Deposit: Successfully deposited materials
12:44:31 AM: Simbatester: Entering Func: MSI_FindItemSlots: Found 0 Bronze pickaxe in inventory
12:44:31 AM: Simbatester: Entering Func: MSI_FindItemSlots: Found 0 Iron pickaxe in inventory
12:44:31 AM: Simbatester: Entering Func: MSI_FindItemSlots: Found 0 Steel pickaxe in inventory
12:44:31 AM: Simbatester: Entering Func: MSI_FindItemSlots: Found 0 Mithril pickaxe in inventory
12:44:31 AM: Simbatester: Entering Func: MSI_FindItemSlots: Found 0 Adamant pickaxe in inventory
12:44:31 AM: Simbatester: Entering Func: MSI_FindItemSlots: Found 0 Rune pickaxe in inventory
12:44:42 AM: Simbatester: Player Action: MSI_MainLoop: Failed to bank materials


its to do with this bit in MSI_BankMaterials in MainLoop.scar
  with MSI_Players[CurrentPlayer] do
begin
SetLength(itemsDeposited, Length(Items[CurrentScript]));

for i := 0 to High(Items[CurrentScript]) do
begin
intItems := MSI_VarToIntArray(Items[CurrentScript][i]);
itemsDeposited[i] := MSI_Deposit(intItems, []);
end;
end;

for i := 0 to High(itemsDeposited) do
if (not itemsDeposited[i]) then
begin
Result := False;
ProgressReportArray[CurrentPlayer].FalseReason := 'Failed to deposit items';
Exit;
end;

what is happening is in the first bit
  with MSI_Players[CurrentPlayer] do
begin
SetLength(itemsDeposited, Length(Items[CurrentScript]));

for i := 0 to High(Items[CurrentScript]) do
begin
intItems := MSI_VarToIntArray(Items[CurrentScript][i]);
itemsDeposited[i] := MSI_Deposit(intItems, []);
end;
end;
it sets the length of itemsDeposited to however many objects there are, then it goes through
the first time it banks everything because im holding the pickaxe and sets itemsDeposited[0] to true
but because everything is banked when it does it again it sets itemsDeposited[1] to false

then in the second bit of code
  for i := 0 to High(itemsDeposited) do
if (not itemsDeposited[i]) then
begin
Result := False;
ProgressReportArray[CurrentPlayer].FalseReason := 'Failed to deposit items';
Exit;
end;
it goes through, sees that itemsDeposited[1] is false, and logs the player out saying that it failed to deposit the items

~shut

Sir R. M8gic1an

2010-07-23 06:57:37

You're wrong…

the code you showed:
ProgressReportArray[CurrentPlayer].FalseReason := 'Failed to deposit items';

the quote:
12:44:42 AM: Simbatester: Player Action: MSI_MainLoop: Failed to bank materials

;)

~RM

Coh3n

2010-07-23 12:10:44

Yeah I noticed this yesterday when I was testing the VEM. It should be fixed now. :)

Shuttleu

2010-07-23 15:18:33

From: Rasta Magician
You're wrong…

the code you showed:
ProgressReportArray[CurrentPlayer].FalseReason := 'Failed to deposit items';

the quote:
12:44:42 AM: Simbatester: Player Action: MSI_MainLoop: Failed to bank materials

;)

~RM


it may be the wrong bit of code for the debug i posted but it is the bit of code that screws up, it sets ProgressReportArray[CurrentPlayer].FalseReason to 'Failed to deposit items' which is used in the progress report, but the fact is that is what is setting the player to false, thus screwing the script/user up

im guessing the only reason why we have not noticed this before is because it is the first bankable script which can have more than one object

~shut

Coh3n

2010-07-23 16:14:14

From: Shuttleu
it may be the wrong bit of code for the debug i posted but it is the bit of code that screws up, it sets ProgressReportArray[CurrentPlayer].FalseReason to 'Failed to deposit items' which is used in the progress report, but the fact is that is what is setting the player to false, thus screwing the script/user up

im guessing the only reason why we have not noticed this before is because it is the first bankable script which can have more than one object

~shut

Yeah you were right, that's where the error is. This worked for me after my fix, is it working for you now?

Shuttleu

2010-07-23 16:30:58

From: Coh3n
Yeah you were right, that's where the error is. This worked for me after my fix, is it working for you now?

now gonna update and test

~shut