Log in

View Full Version : access violation



Shuttleu
12-16-2010, 10:58 PM
anyone know why i get a access violation
the error is at compile time
program ReflectionScript;
{$DEFINE SMART}
{$i srl\srl.scar}
{$i reflection\reflection.simba}
{$i srl/srl/misc/paintsmart.scar}

const


{---SMART Setup Constants---}
WORLD = 32;
MEMBERS = false;
SIGNED = true;
{---------------------------}

var
NPCs: TNPCArray;
Dots: array of TPointArray;
Colors: TIntegerArray;
i: Integer;
sdf:tstringarray;

begin
Smart_Members := MEMBERS;
Smart_Server := WORLD;
Smart_Signed := SIGNED;

SetupSRL;
SetupReflectionEx(true);

SetArrayLength(Dots, 3);

Colors:= [255, 16776960, 65280];

repeat
NPCs:= GetNPCs;
for i:=0 to High(NPCs) do
if InStrArr('Attack', NPCs[i].Actions, True) then
if (NPCs[i].Level < GetMe.Level) then
begin
SetArrayLength(Dots[0], Length(Dots[0])+1);
Dots[0][High(Dots[0])]:= TileToMM(NPCs[i].Tile);
end else
if (NPCs[i].Level = GetMe.Level) then
begin
SetArrayLength(Dots[1], Length(Dots[1])+1);
Dots[1][High(Dots[1])]:= TileToMM(NPCs[i].Tile);
end else
if (NPCs[i].Level > GetMe.Level) then
begin
SetArrayLength(Dots[2], Length(Dots[2])+1);
Dots[2][High(Dots[2])]:= TileToMM(NPCs[i].Tile);
end;
SMART_DrawDotsEx(True, Dots[0], Colors[0]);
SMART_DrawDotsEx(False, Dots[1], Colors[1]);
SMART_DrawDotsEx(False, Dots[2], Colors[2]);
until(false);
end.

~shut

Frement
12-16-2010, 11:06 PM
It's the SMART that bugs afaik.

Shuttleu
12-16-2010, 11:10 PM
the error is at compile time

~shut

Frement
12-16-2010, 11:14 PM
the error is at compile time

~shut

I meant, some function that is used from smart.scar.

Shuttleu
12-16-2010, 11:14 PM
i habe got it down to these lines
if (NPCs[i].Level < GetMe.Level) then
if (NPCs[i].Level = GetMe.Level) then
if (NPCs[i].Level > GetMe.Level) then

~shut

Frement
12-16-2010, 11:15 PM
i habe got it down to these lines
if (NPCs[i].Level < GetMe.Level) then
if (NPCs[i].Level = GetMe.Level) then
if (NPCs[i].Level > GetMe.Level) then

~shut

Yes, its the GetMe.Level

Shuttleu
12-16-2010, 11:17 PM
ah fixed it

Level:= GetMe.Level;
if (NPCs[i].Level < Level) then
if (NPCs[i].Level = Level) then
if (NPCs[i].Level > Level) then

~shut

Death12652
12-23-2010, 02:14 PM
Did you get an error in players.scar becuase I keep getting an access violation in the LoggedIn function of at Result := part