diff --git a/src/game/g_panel.pas b/src/game/g_panel.pas
index 3c95a56ffe7f3b07724ad060b99a995f7fad3c26..94e7b877488b8963eb05bbcb924d0161fe7a7bf4 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;
+var
+ px, py, pw, ph: Integer;
begin
- if (proxyId >= 0) then mapGrid.moveBody(proxyId, X, Y);
+ if (proxyId >= 0) then
+ begin
+ monsGrid.getBodyDims(proxyId, px, py, pw, ph);
+ if (px <> x) or (py <> y) or (pw <> Width) or (ph <> Height) then
+ begin
+ g_Mark(px, py, pw, ph, MARK_WALL, false);
+ if (pw <> Width) or (ph <> Height) then mapGrid.moveResizeBody(proxyId, X, Y, Width, Height)
+ else mapGrid.moveBody(proxyId, X, Y);
+ g_Mark(X, Y, Width, Height, MARK_WALL);
+ end;
+ end;
end;
if (mMovingSpeed.Y < 0) and (ny <= mMovingStart.Y) then mMovingSpeed.Y := -mMovingSpeed.Y
else if (mMovingSpeed.Y > 0) and (ny >= mMovingEnd.Y) then mMovingSpeed.Y := -mMovingSpeed.Y;
// awake particles
- g_Mark(X, Y, Width, Height, MARK_WALL, false);
+ //g_Mark(X, Y, Width, Height, MARK_WALL, false);
X := nx;
Y := ny;
- g_Mark(nx, ny, Width, Height, MARK_WALL);
+ //g_Mark(nx, ny, Width, Height, MARK_WALL);
// fix grid
positionChanged();
// notify moved monsters about their movement
Mem.ReadInt(mMovingEnd.Y);
Mem.ReadBoolean(mMovingActive);
- if (proxyId >= 0) then mapGrid.moveBody(proxyId, X, Y);
+ positionChanged();
+ //mapGrid.proxyEnabled[proxyId] := FEnabled; // done in g_map.pas
end;
end.