diff --git a/src/game/g_grid.pas b/src/game/g_grid.pas
index 049868c7821e7784afa08dbe18e68ab97c0d6a31..17ad2fceed471807171d121fac437b57837e099c 100644 (file)
--- a/src/game/g_grid.pas
+++ b/src/game/g_grid.pas
// ////////////////////////////////////////////////////////////////////////// //
function TBodyGridBase.getProxyEnabled (pid: TBodyProxyId): Boolean; inline;
begin
- if (pid >= 0) then result := ((mProxies[pid].mTag and TagDisabled) = 0) else result := false;
+ if (pid >= 0) and (pid < Length(mProxies)) then result := ((mProxies[pid].mTag and TagDisabled) = 0) else result := false;
end;
procedure TBodyGridBase.setProxyEnabled (pid: TBodyProxyId; val: Boolean); inline;
begin
- if (pid >= 0) then
+ if (pid >= 0) and (pid < Length(mProxies)) then
begin
if val then
begin
function TBodyGridBase.getProxyById (idx: TBodyProxyId): PBodyProxyRec; inline;
begin
- if (idx >= 0) and (idx < High(mProxies)) then result := @mProxies[idx] else result := nil;
+ if (idx >= 0) and (idx < Length(mProxies)) then result := @mProxies[idx] else result := nil;
end;