Wolygon
05-08-2011, 12:07 PM
Hey, I am having this problem and I really have no idea how it is happening. The code is below (note its just an example):
procedure test;
var
NPC1, NPC2 : TNPC;
begin
NPC1 := GetNPC(4690);
NPC2 := GetNPC(4689);
WriteLn('NPC 1 is ' + IntToStr(NPC1.ID));
WriteLn('NPC 2 is ' + IntToStr(NPC2.ID));
Wait(100);
if (NPC1.ID = 4690) and (NPC2.ID = 4089) then WriteLn('Both found')
else WriteLn('Both not found, < 1 present');
end;
It outputs this:
NPC 1 is 4690
NPC 2 is 4689
Both not found, < 1 present
So the debug shows that the IDs are equal to what I ask in the if statement yet the if statement fails. Really not getting how this is wrong...
*hopes it isn't something really noob*
Hope you can help, thanks.
procedure test;
var
NPC1, NPC2 : TNPC;
begin
NPC1 := GetNPC(4690);
NPC2 := GetNPC(4689);
WriteLn('NPC 1 is ' + IntToStr(NPC1.ID));
WriteLn('NPC 2 is ' + IntToStr(NPC2.ID));
Wait(100);
if (NPC1.ID = 4690) and (NPC2.ID = 4089) then WriteLn('Both found')
else WriteLn('Both not found, < 1 present');
end;
It outputs this:
NPC 1 is 4690
NPC 2 is 4689
Both not found, < 1 present
So the debug shows that the IDs are equal to what I ask in the if statement yet the if statement fails. Really not getting how this is wrong...
*hopes it isn't something really noob*
Hope you can help, thanks.