SRL Archive - SRL Bugs

OpenBank Problem


YoHoJo

2011-12-03 21:00:38

So openbank is like this:
function OpenBank(WhichBank: string; ChangeCompass, ChangeAngle: Boolean): Boolean;
var
I: Integer;
begin
result := false;
if BankScreen then
begin
Result := True;
Exit;
end;

for I := 0 to 3 do
begin
case I of
0: Result := OpenBankFast(WhichBank);
1: Result := OpenBankGlass(WhichBank, ChangeCompass, ChangeAngle);
2: Result := OpenBankQuiet(WhichBank);
3: Result := OpenBankNPC;
end;

if Result then
Exit;
end;
end;

As you can see it basically chooses a random open bank function for given bank.

Problem is that THREE of those support all banks, but ONE of them does not!
OpenBankQuiet only supports
'feb' (Falador East Bank)
'fwb' (Falador West Bank)
'veb' (Varrock East Bank)
'vwb' (Varrock West Bank)
'db' (Draynor Bank)
'eb' (Edgeville Bank)
'akb' (Al-Kharid Bank)

So when users call OpenBank (and enter a non-supported bank by OpenBankQuet) they have a 1 in 4 chance of getting
srl_Warn('OpenBankQuiet', 'Unknown bank: ' + WhichBank, warn_AllVersions); 
and the script failing.

So either remove OpenBankQuiet from OpenBank OR have OpenBankQuiet support all banks!

Flight

2011-12-03 22:06:22

Good catch.

shstiger2009

2011-12-05 13:38:20

We'll get it fixed eventually, YoHoJo! :p

Coh3n

2011-12-09 00:05:13

Better to just remove OpenBankQuiet in my opinion, unless it can actually support all the banks. My guess is that there's a reason some banks are excluded.

E: Actually, I don't think there's anything wrong with it. It doesn't randomly pick a function, it tries all 4, meaning if the bank isn't supported my OpenBankGlass, it'll just go on to the next function.

NCDS

2011-12-09 00:08:37

From: Coh3n
Better to just remove OpenBankQuiet in my opinion, unless it can actually support all the banks. My guess is that there's a reason some banks are excluded.

E: Actually, I don't think there's anything wrong with it. It doesn't randomly pick a function, it tries all 4, meaning if the bank isn't supported my OpenBankGlass, it'll just go on to the next function.


Not that this is a topic to be discussed here, but it relates; I had planned to slim down the banking functions with SRL6 as many are rarely, if ever used.