SRL Archive - General

function BankCheck


Sir R. M8gic1an

2010-08-08 10:04:10

I found this repeated in Mainloop

{******************************************************************************}
{ function MSI_BankCheck: Boolean; }
{ By: MSI Team }
{ Date: 8 Aug 2010 }
{ Description: Attempts to open the correct bank }
{******************************************************************************}
function MSI_BankCheck: boolean;
begin
case (MSI_Players[CurrentPlayer].Location) of
LOC_VE_BANK:
Result := MSI_OpenBank(MSI_BANK_VE, MSI_Players[CurrentPlayer].Pin);

LOC_DB_BANK:
Result := MSI_OpenBank(MSI_BANK_DB, MSI_Players[CurrentPlayer].Pin);

LOC_FE_BANK:
Result := MSI_OpenBank(MSI_BANK_FE, MSI_Players[CurrentPlayer].Pin);

LOC_GE_BANK:
Result := MSI_OpenBank(MSI_BANK_GE, MSI_Players[CurrentPlayer].Pin);

LOC_PS_DBOX:
Result := MSI_OpenBank(DBOX_PS, MSI_Players[CurrentPlayer].Pin);

else
MSI_SubDebug('Invalid PlayerLocation');
end;
end;

I'll be committing the function along with the new debug, as soon as I'm done which should be soon. :)

~RM

Coh3n

2010-08-08 11:19:34

Oops, I missed that when doing the "Changes to the core". I changed it in MSI_BankMaterials, but not SetupPlayers.

We don't need a function like that as there's now a WhichBank attribute in the TScript record. Take a look at BankMaterials if you need to.