diff --git a/src/game/g_items.pas b/src/game/g_items.pas
index a70bd54a61f9da0f9827996db6e1d654090da1df..8d476efe76e6fa3fc1c27f98644e2def961704b4 100644 (file)
--- a/src/game/g_items.pas
+++ b/src/game/g_items.pas
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
- * the Free Software Foundation, either version 3 of the License, or
- * (at your option) any later version.
+ * the Free Software Foundation, version 3 of the License ONLY.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
var
gItemsTexturesID: Array [1..ITEM_MAX] of DWORD;
gMaxDist: Integer = 1; // for sounds
- ITEM_RESPAWNTIME: Integer = 60 * 36;
implementation
it.ItemType := ItemType;
it.Respawnable := Respawnable;
- if g_Game_IsServer and (ITEM_RESPAWNTIME = 0) then it.Respawnable := False;
it.InitX := X;
it.InitY := Y;
it.RespawnTime := 0;
i, j, k: Integer;
ID: DWord;
Anim: TAnimation;
- m: Word;
+ m, ItemRespawnTime: Word;
r, nxt: Boolean;
begin
if (ggItems = nil) then exit;
+ // respawn items in 15 seconds regardless of settings during warmup
+ ItemRespawnTime := IfThen(gLMSRespawn = LMS_RESPAWN_NONE, gGameSettings.ItemRespawnTime, 15);
+
for i := 0 to High(ggItems) do
begin
if (ggItems[i].ItemType = ITEM_NONE) then continue;
// Íàäî óáðàòü ñ êàðòû, åñëè ýòî íå êëþ÷, êîòîðûì íóæíî ïîäåëèòüñÿ ñ äðóãèì èãðîêîì
if r then
begin
- if not Respawnable then g_Items_Remove(i) else g_Items_Pick(i);
+ if not (Respawnable and (ItemRespawnTime > 0)) then
+ g_Items_Remove(i)
+ else
+ g_Items_Pick(i);
if g_Game_IsNet then MH_SEND_ItemDestroy(False, i);
nxt := True;
break;
if (ID < Length(ggItems)) then
begin
ggItems[ID].alive := false;
- ggItems[ID].RespawnTime := ITEM_RESPAWNTIME;
+ ggItems[ID].RespawnTime := IfThen(gLMSRespawn = LMS_RESPAWN_NONE, gGameSettings.ItemRespawnTime, 15) * 36;
end;
end;