summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: fa0f77a)
raw | patch | inline | side by side (parent: fa0f77a)
author | Ketmar Dark <ketmar@ketmar.no-ip.org> | |
Sat, 2 Sep 2017 00:32:43 +0000 (03:32 +0300) | ||
committer | Ketmar Dark <ketmar@ketmar.no-ip.org> | |
Sat, 2 Sep 2017 00:40:11 +0000 (03:40 +0300) |
src/game/g_grid.pas | patch | blob | history | |
src/game/g_panel.pas | patch | blob | history |
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;
diff --git a/src/game/g_panel.pas b/src/game/g_panel.pas
index 3c95a56ffe7f3b07724ad060b99a995f7fad3c26..7e6a135bf13bb233ca5b9b65f03af49ac21fec26 100644 (file)
--- a/src/game/g_panel.pas
+++ b/src/game/g_panel.pas
procedure SaveState(var Mem: TBinMemoryWriter);
procedure LoadState(var Mem: TBinMemoryReader);
- procedure positionChanged ();
+ procedure positionChanged (); inline;
function isGBack (): Boolean; inline; // gRenderBackgrounds
function isGStep (): Boolean; inline; // gSteps
end;
-procedure TPanel.positionChanged ();
+procedure TPanel.positionChanged (); inline;
begin
if (proxyId >= 0) then mapGrid.moveBody(proxyId, X, Y);
end;
Mem.ReadInt(mMovingEnd.Y);
Mem.ReadBoolean(mMovingActive);
- if (proxyId >= 0) then mapGrid.moveBody(proxyId, X, Y);
+ positionChanged();
+ mapGrid.proxyEnabled[proxyId] := FEnabled;
end;
end.