X-Git-Url: http://deadsoftware.ru/gitweb?a=blobdiff_plain;f=src%2Fgame%2Fg_map.pas;h=570d5e2413c66732c51084fdc17e37e62fc50708;hb=9ba8ea50592447e5c5874f94338e7dd75f5a35ed;hp=20bfa3bf1bee93ff29bc5471cb86a60cf214941a;hpb=05a8dcb37440aa1f010e418de05ecc153340956f;p=d2df-sdl.git diff --git a/src/game/g_map.pas b/src/game/g_map.pas index 20bfa3b..570d5e2 100644 --- a/src/game/g_map.pas +++ b/src/game/g_map.pas @@ -54,6 +54,7 @@ type CaptureTime: LongWord; Animation: TAnimation; Direction: TDirection; + NeedSend: Boolean; end; function g_Map_Load(Res: String): Boolean; @@ -2567,8 +2568,13 @@ begin begin if gFlags[a].Animation <> nil then gFlags[a].Animation.Update(); + Obj.oldX := Obj.X; + Obj.oldY := Obj.Y; + m := g_Obj_Move(@Obj, True, True); + NeedSend := NeedSend or (Obj.X <> Obj.oldX) or (Obj.Y <> Obj.oldY); + if gTime mod (GAME_TICK*2) <> 0 then Continue; // Ñîïðîòèâëåíèå âîçäóõà @@ -3153,6 +3159,9 @@ begin Direction := FlagPoints[Flag]^.Direction; State := FLAG_STATE_NORMAL; end; + Obj.oldX := Obj.X; + Obj.oldY := Obj.Y; + NeedSend := False; // the event will take care of this Count := -1; end; end; @@ -3160,6 +3169,7 @@ end; procedure g_Map_DrawFlags(); var i, dx: Integer; + tx, ty: Integer; Mirror: TMirrorType; begin if gGameSettings.GameMode <> GM_CTF then @@ -3172,6 +3182,8 @@ begin if State = FLAG_STATE_NONE then continue; + Obj.lerp(gLerpFactor, tx, ty); + if Direction = TDirection.D_LEFT then begin Mirror := TMirrorType.Horizontal; @@ -3183,7 +3195,7 @@ begin dx := 1; end; - Animation.Draw(Obj.X+dx, Obj.Y+1, Mirror); + Animation.Draw(tx+dx, ty+1, Mirror); if g_debug_Frames then begin