X-Git-Url: https://deadsoftware.ru/gitweb?a=blobdiff_plain;f=src%2Fgame%2Fg_panel.pas;h=94e7b877488b8963eb05bbcb924d0161fe7a7bf4;hb=3f758d569aeb250474aece9c4051f05ad7362805;hp=3c95a56ffe7f3b07724ad060b99a995f7fad3c26;hpb=d3ce22f70dfe266676a3fb95d5193238ff5b9e72;p=d2df-sdl.git diff --git a/src/game/g_panel.pas b/src/game/g_panel.pas index 3c95a56..94e7b87 100644 --- a/src/game/g_panel.pas +++ b/src/game/g_panel.pas @@ -93,7 +93,7 @@ type 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 @@ -439,9 +439,21 @@ begin 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; @@ -552,10 +564,10 @@ begin 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 @@ -784,7 +796,8 @@ begin 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.