Coh3n
2012-03-28 15:10:08
FIXED: http://villavu.com/forum/showpost.php?p=978487&postcount=12
Link to SPS source: https://github.com/Coh3n/SPS/blob/sps_2.0/plugin/source/sps.lpr
Back again with an access violation with the new (unreleased) SPS. I'm looking for suggestions on things to try to pinpoint the error, or better yet, resolve it.
Error:
Thanks in advance,
Cohen
Link to SPS source: https://github.com/Coh3n/SPS/blob/sps_2.0/plugin/source/sps.lpr
Back again with an access violation with the new (unreleased) SPS. I'm looking for suggestions on things to try to pinpoint the error, or better yet, resolve it.
Error:
Error: Exception: Access violation at line 254
Line 254:
SmallMap := SPS_BitmapToMap(Minimap, SPS_SIDE_LENGTH);
SPS_BitmapToMap, from the plugin:
function SPS_BitmapToMap(bmp: TMufasaBitmap; SideLength: integer): T3DIntegerArray; register;
var
X, Y, HighX, HighY: integer;
begin
HighX := Trunc(bmp.Width / (SideLength * 1.0));
HighY := Trunc(bmp.Height / (SideLength * 1.0));
SetLength(Result, HighX);
for X := 0 to HighX - 1 do
begin
SetLength(Result[X], HighY);
for Y := 0 to HighY - 1 do
begin
Result[X][Y] := SPS_MakeColorBox(bmp, X * SideLength, Y * SideLength, SideLength);
end;
end;
end;
What I've figured out:- The plugin memory manager is exported exactly as it is in the old SPS. You can check the source here.
- It only happens when SPS_GetMyPos() has been called more than once.
- It only happens when Simba is opened by double clicking the .simba file. If it's opened any other way, there's no error. This is what I find really strange.
- The bitmap (Minimap) is valid. If it wasn't, Simba would give another error when SPS_GatherMinimap is called. It's also debugged in SPS_GetMyPos(), and everything is normal.
- I've run Simba through Lazarus, and all I got was this and this.
- When the test script is opened, there's no indication in the cmd of the plugin memory manager being set (not sure if there's supposed to be).
program spsTest;
//{$DEFINE SMART}
{$i srl/srl.simba}
{$i sps/sps.simba}
procedure antiban();
begin
end;
begin
smart_server := 1;
smart_members := false;
smart_signed := true;
smart_superDetail := false;
activateClient();
clearDebug();
setupSRL();
SPS_Debug := true;
SRL_Procs[SRL_Antiban] := @antiban;
//Writeln(toStr(SPS_WindWalk(point(4353, 3025))));
//Writeln(toStr(SPS_WindWalk(point(4579, 2906))));
//SPS_Setup(RUNESCAPE_SURFACE, ['11_7', '12_7']); // VEB
//SPS_Setup(RUNESCAPE_SURFACE, ['11_7']); // Varrock Center
//SPS_Setup(RUNESCAPE_SURFACE, ['12_9']); // AK Bank
//SPS_Setup(RUNESCAPE_SURFACE, ['10_8', '10_9']); // DB
SPS_Setup(RUNESCAPE_SURFACE, ['10_7', '11_7']); // VWB
SPS_GetMyPos();
SPS_GetMyPos(); // error occurs on this call, not the first
SPS_GetMyPos();
end.
Any suggestions are appreciated.Thanks in advance,
Cohen