we chose integers because its for a dll.
Code:
function IsWorldValid(aWorld: Integer): Boolean;
Begin
Result := GPhysicsWorlds.IndexOf(Pointer(aWorld)) > -1;
end;
Code:
function IsBodyValid(aWorld, aBody: Integer): Boolean;
Begin
Result := False;
if aWorld <> -1 then
if not IsWorldValid(aWorld) then
Exit;
Result := TRPWorld(aWorld).Bodies.IndexOf(Pointer(aBody)) > -1;
end;
this is to try speedup the IsBodyValid, or at least remove the IndexOf()
Bookmarks