X-Git-Url: http://deadsoftware.ru/gitweb?a=blobdiff_plain;f=src%2Fgame%2Fg_items.pas;h=0aa9d560ab9b00cd002fbca4ac994b9f80a76ede;hb=d55f78661cd9bd77609beed2552d7dd6262ad65c;hp=88a9cba1c433057f3ede53d4bf118ad43aecbc9c;hpb=dffafd305d0df029f317cc92c1968ba0065c0cd8;p=d2df-sdl.git diff --git a/src/game/g_items.pas b/src/game/g_items.pas index 88a9cba..0aa9d56 100644 --- a/src/game/g_items.pas +++ b/src/game/g_items.pas @@ -41,6 +41,7 @@ Type Obj: TObj; Animation: TAnimation; dropped: Boolean; // dropped from the monster? drops should be rendered after corpses, so zombie corpse will not obscure ammo container, for example + NeedSend: Boolean; procedure positionChanged (); //WARNING! call this after monster position was changed, or coldet will not work right! @@ -133,6 +134,7 @@ end; // ////////////////////////////////////////////////////////////////////////// // procedure TItem.positionChanged (); begin + NeedSend := NeedSend or (Obj.X <> Obj.oldX) or (Obj.Y <> Obj.oldY); end; @@ -348,6 +350,7 @@ begin it.alive := False; it.SpawnTrigger := -1; it.ItemType := ITEM_NONE; + it.NeedSend := false; freeIds.release(LongWord(idx)); end; @@ -371,6 +374,7 @@ begin it.alive := false; it.SpawnTrigger := -1; it.Respawnable := false; + it.NeedSend := false; //if not freeIds.hasFree[LongWord(i)] then raise Exception.Create('internal error in item idx manager'); end; end; @@ -461,10 +465,9 @@ begin it.alive := True; it.QuietRespawn := False; it.dropped := false; + it.NeedSend := false; g_Obj_Init(@it.Obj); - it.Obj.oldX := X; - it.Obj.oldY := Y; it.Obj.X := X; it.Obj.Y := Y; it.Obj.Rect.Width := ITEMSIZE[ItemType][0]; @@ -485,6 +488,9 @@ begin end; end; + it.Obj.oldX := it.Obj.X; + it.Obj.oldY := it.Obj.Y; + // Óñòàíîâêà àíèìàöèè case it.ItemType of ITEM_ARMOR_GREEN: if g_Frames_Get(ID, 'FRAMES_ITEM_ARMORGREEN') then it.Animation := TAnimation.Create(ID, True, 20);