X-Git-Url: https://deadsoftware.ru/gitweb?a=blobdiff_plain;f=src%2Fgame%2Fg_netmsg.pas;h=33d16522865e7e122b6bdbe9e7f9c76c90c43b74;hb=15ef0fb2d44e381afb8d0ea07cdb31fd3903ba7b;hp=53ab6a501b063c2cae51a19a9edcf326df2840a4;hpb=d3ce22f70dfe266676a3fb95d5193238ff5b9e72;p=d2df-sdl.git diff --git a/src/game/g_netmsg.pas b/src/game/g_netmsg.pas index 53ab6a5..33d1652 100644 --- a/src/game/g_netmsg.pas +++ b/src/game/g_netmsg.pas @@ -2604,10 +2604,6 @@ begin with Mon do begin - GameX := X; - GameY := Y; - GameVelX := VX; - GameVelY := VY; MonsterAnim := MAnim; MonsterTargetUID := MTarg; @@ -2619,7 +2615,10 @@ begin SetState(MState); - positionChanged(); // this updates spatial accelerators + setPosition(X, Y); // this will call positionChanged(); + GameVelX := VX; + GameVelY := VY; + //positionChanged(); // this updates spatial accelerators end; end; @@ -2627,6 +2626,7 @@ procedure MC_RECV_MonsterPos(var M: TMsg); var Mon: TMonster; ID: Word; + X, Y: Integer; begin ID := M.ReadWord(); Mon := g_Monsters_ByUID(ID); @@ -2635,12 +2635,13 @@ begin with Mon do begin - GameX := M.ReadLongInt(); - GameY := M.ReadLongInt(); + X := M.ReadLongInt(); + Y := M.ReadLongInt(); + Mon.setPosition(X, Y); // this will call `positionChanged()` GameVelX := M.ReadLongInt(); GameVelY := M.ReadLongInt(); GameDirection := TDirection(M.ReadByte()); - positionChanged(); // this updates spatial accelerators + //positionChanged(); // this updates spatial accelerators end; end;