diff --git a/src/game/g_items.pas b/src/game/g_items.pas
index 33ab113df1c2552399ef7712825c7d43040a9c2a..e81bdd4caa55ddb98fa3c877a8dacd0b4adfda5d 100644 (file)
--- a/src/game/g_items.pas
+++ b/src/game/g_items.pas
uses
SysUtils, Classes,
- MAPDEF, g_textures, g_phys, g_saveload;
+ MAPDEF, g_phys, g_saveload;
Type
PItem = ^TItem;
QuietRespawn: Boolean;
SpawnTrigger: Integer;
Obj: TObj;
- Animation: TAnimationState;
dropped: Boolean; // dropped from the monster? drops should be rendered after corpses, so zombie corpse will not obscure ammo container, for example
NeedSend: Boolean;
if not it.slotIsUsed then raise Exception.Create('releaseItem: trying to release unallocated item (1)');
if (it.arrIdx <> idx) then raise Exception.Create('releaseItem: arrIdx inconsistency');
it.slotIsUsed := false;
- if (it.Animation <> nil) then
- begin
- it.Animation.Free();
- it.Animation := nil;
- end;
it.alive := False;
it.SpawnTrigger := -1;
it.ItemType := ITEM_NONE;
it.slotIsUsed := false;
it.arrIdx := i;
it.ItemType := ITEM_NONE;
- it.Animation := nil;
it.alive := false;
it.SpawnTrigger := -1;
it.Respawnable := false;
procedure g_Items_Free ();
-var
- i: Integer;
begin
if (ggItems <> nil) then
- begin
- for i := 0 to High(ggItems) do ggItems[i].Animation.Free();
ggItems := nil;
- end;
freeIds.clear();
end;
it.Obj.Rect.Width := ITEMSIZE[ItemType][0];
it.Obj.Rect.Height := ITEMSIZE[ItemType][1];
- it.Animation := nil;
it.SpawnTrigger := -1;
// Êîîðäèíàòû îòíîñèòåëüíî öåíòðà íèæíåãî ðåáðà
it.Obj.oldX := it.Obj.X;
it.Obj.oldY := it.Obj.Y;
- // Óñòàíîâêà àíèìàöèè
- case it.ItemType of
- ITEM_ARMOR_GREEN: it.Animation := TAnimationState.Create(True, 20, 3);
- ITEM_ARMOR_BLUE: it.Animation := TAnimationState.Create(True, 20, 3);
- ITEM_JETPACK: it.Animation := TAnimationState.Create(True, 15, 3);
- ITEM_SPHERE_BLUE: it.Animation := TAnimationState.Create(True, 15, 4);
- ITEM_SPHERE_WHITE: it.Animation := TAnimationState.Create(True, 20, 4);
- ITEM_INVUL: it.Animation := TAnimationState.Create(True, 20, 4);
- ITEM_INVIS: it.Animation := TAnimationState.Create(True, 20, 4);
- ITEM_BOTTLE: it.Animation := TAnimationState.Create(True, 20, 4);
- ITEM_HELMET: it.Animation := TAnimationState.Create(True, 20, 4);
- end;
-
it.positionChanged();
result := find_id;
QuietRespawn := false;
end;
end;
-
- if (Animation <> nil) then Animation.Update();
end;
end;
end;