DEADSOFTWARE

nuke g_respawn_items
authorfgsfds <pvt.fgsfds@gmail.com>
Mon, 24 Feb 2020 15:55:48 +0000 (18:55 +0300)
committerfgsfds <pvt.fgsfds@gmail.com>
Mon, 24 Feb 2020 15:55:48 +0000 (18:55 +0300)
src/game/g_console.pas
src/game/g_game.pas
src/game/g_items.pas
src/game/g_language.pas
src/game/g_menu.pas
src/game/g_options.pas

index 01cd41ab1c677fa9c45a791de02d2a7ea4d59644..94b65318a091c51e78dfa8f2fcfc268c489a8aa3 100644 (file)
@@ -929,7 +929,6 @@ begin
   AddCommand('g_maxlives', GameCVars);
   AddCommand('g_warmuptime', GameCVars);
   AddCommand('g_spawn_invul', GameCVars);
   AddCommand('g_maxlives', GameCVars);
   AddCommand('g_warmuptime', GameCVars);
   AddCommand('g_spawn_invul', GameCVars);
-  AddCommand('g_respawn_items', GameCVars);
   AddCommand('net_interp', GameCVars);
   AddCommand('net_forceplayerupdate', GameCVars);
   AddCommand('net_predictself', GameCVars);
   AddCommand('net_interp', GameCVars);
   AddCommand('net_forceplayerupdate', GameCVars);
   AddCommand('net_predictself', GameCVars);
@@ -1036,7 +1035,6 @@ begin
   WhitelistCommand('g_scorelimit');
   WhitelistCommand('g_timelimit');
   WhitelistCommand('g_dm_keys');
   WhitelistCommand('g_scorelimit');
   WhitelistCommand('g_timelimit');
   WhitelistCommand('g_dm_keys');
-  WhitelistCommand('g_respawn_items');
   WhitelistCommand('g_spawn_invul');
   WhitelistCommand('g_warmuptime');
 
   WhitelistCommand('g_spawn_invul');
   WhitelistCommand('g_warmuptime');
 
index feaf1591041441ee1e22591c3d7d371bf5fc361b..0395bf4c9f05bae2fc2a68023d795d51d2867c05 100644 (file)
@@ -180,7 +180,6 @@ const
   GAME_OPTION_BOTVSPLAYER  = 32;
   GAME_OPTION_BOTVSMONSTER = 64;
   GAME_OPTION_DMKEYS       = 128;
   GAME_OPTION_BOTVSPLAYER  = 32;
   GAME_OPTION_BOTVSMONSTER = 64;
   GAME_OPTION_DMKEYS       = 128;
-  GAME_OPTION_RESPAWNITEMS = 256;
 
   STATE_NONE        = 0;
   STATE_MENU        = 1;
 
   STATE_NONE        = 0;
   STATE_MENU        = 1;
@@ -5557,27 +5556,6 @@ begin
       if g_Game_IsNet then MH_SEND_GameSettings;
     end;
   end
       if g_Game_IsNet then MH_SEND_GameSettings;
     end;
   end
-  else if (cmd = 'g_respawn_items') and not g_Game_IsClient then
-  begin
-    with gGameSettings do
-    begin
-      if (Length(P) > 1) and
-         ((P[1] = '1') or (P[1] = '0')) then
-      begin
-        if (P[1][1] = '1') then
-          Options := Options or GAME_OPTION_RESPAWNITEMS
-        else
-          Options := Options and (not GAME_OPTION_RESPAWNITEMS);
-      end;
-
-      if (LongBool(Options and GAME_OPTION_RESPAWNITEMS)) then
-        g_Console_Add(_lc[I_MSG_RESPAWNITEMS_ON])
-      else
-        g_Console_Add(_lc[I_MSG_RESPAWNITEMS_OFF]);
-
-      if g_Game_IsNet then MH_SEND_GameSettings;
-    end;
-  end
   else if (cmd = 'g_warmuptime') and not g_Game_IsClient then
   begin
     if Length(P) > 1 then
   else if (cmd = 'g_warmuptime') and not g_Game_IsClient then
   begin
     if Length(P) > 1 then
index ae047f82b8afcc86bfa283e05012af0964c9b3a5..9693ad07f31270f0d4e691a33ebcd66de8cbe04d 100644 (file)
@@ -509,7 +509,6 @@ var
   Anim: TAnimation;
   m: Word;
   r, nxt: Boolean;
   Anim: TAnimation;
   m: Word;
   r, nxt: Boolean;
-  actualRespawnable: Boolean;
 begin
   if (ggItems = nil) then exit;
 
 begin
   if (ggItems = nil) then exit;
 
@@ -577,9 +576,10 @@ begin
               // Íàäî óáðàòü ñ êàðòû, åñëè ýòî íå êëþ÷, êîòîðûì íóæíî ïîäåëèòüñÿ ñ äðóãèì èãðîêîì
               if r then
               begin
               // Íàäî óáðàòü ñ êàðòû, åñëè ýòî íå êëþ÷, êîòîðûì íóæíî ïîäåëèòüñÿ ñ äðóãèì èãðîêîì
               if r then
               begin
-                actualRespawnable := Respawnable
-                  and ((ITEM_RESPAWNTIME > 0) and LongBool(gGameSettings.Options and GAME_OPTION_RESPAWNITEMS));
-                if not actualRespawnable then g_Items_Remove(i) else g_Items_Pick(i);
+                if not (Respawnable and (ITEM_RESPAWNTIME > 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 g_Game_IsNet then MH_SEND_ItemDestroy(False, i);
                 nxt := True;
                 break;
index 09021f5cd3981736eeadc30dffde6d41465a216b..8d5ea098ae9488b74e9b9737620127b330bf391a 100644 (file)
@@ -162,7 +162,7 @@ type
     I_MENU_GOAL_LIMIT,
     I_MENU_MAX_LIVES,
     I_MENU_TEAM_DAMAGE,
     I_MENU_GOAL_LIMIT,
     I_MENU_MAX_LIVES,
     I_MENU_TEAM_DAMAGE,
-    I_MENU_RESPAWN_ITEMS,
+    I_MENU_ITEM_RESPAWN_TIME,
     I_MENU_DEATHMATCH_KEYS,
     I_MENU_ENABLE_EXITS,
     I_MENU_WEAPONS_STAY,
     I_MENU_DEATHMATCH_KEYS,
     I_MENU_ENABLE_EXITS,
     I_MENU_WEAPONS_STAY,
@@ -575,8 +575,6 @@ type
     I_MSG_ALLOWMON_OFF,
     I_MSG_DMKEYS_ON,
     I_MSG_DMKEYS_OFF,
     I_MSG_ALLOWMON_OFF,
     I_MSG_DMKEYS_ON,
     I_MSG_DMKEYS_OFF,
-    I_MSG_RESPAWNITEMS_ON,
-    I_MSG_RESPAWNITEMS_OFF,
     I_MSG_BOTSVSPLAYERS_ON,
     I_MSG_BOTSVSPLAYERS_OFF,
     I_MSG_BOTSVSMONSTERS_ON,
     I_MSG_BOTSVSPLAYERS_ON,
     I_MSG_BOTSVSPLAYERS_OFF,
     I_MSG_BOTSVSMONSTERS_ON,
@@ -924,8 +922,8 @@ const
                                        'Æèçíè:'),
     ('MENU TEAM DAMAGE',               'Friendly Fire:',
                                        'Óðîí ñâîèõ:'),
                                        'Æèçíè:'),
     ('MENU TEAM DAMAGE',               'Friendly Fire:',
                                        'Óðîí ñâîèõ:'),
-    ('MENU RESPAWN ITEMS',             'Respawn Items:',
-                                       'Ðåñïàâíèòü ïðåäìåòû:'),
+    ('MENU ITEM RESPAWN TIME',         'Item respawn time:',
+                                       'Âðåìÿ ðåñïàâíà ïðåäìåòîâ:'),
     ('MENU DEATHMATCH KEYS',           'Give all keys in DM:',
                                        'Âñå êëþ÷è â DM:'),
     ('MENU ENABLE EXITS',              'Enable Exit:',
     ('MENU DEATHMATCH KEYS',           'Give all keys in DM:',
                                        'Âñå êëþ÷è â DM:'),
     ('MENU ENABLE EXITS',              'Enable Exit:',
@@ -1711,10 +1709,6 @@ const
                                        'Ðåñïàâí ñî âñåìè êëþ÷àìè â DM âêëþ÷åí'),
     ('MSG DMKEYS OFF',                 'Spawning with all keys in DM disabled',
                                        'Ðåñïàâí ñî âñåìè êëþ÷àìè â DM âûêëþ÷åí'),
                                        'Ðåñïàâí ñî âñåìè êëþ÷àìè â DM âêëþ÷åí'),
     ('MSG DMKEYS OFF',                 'Spawning with all keys in DM disabled',
                                        'Ðåñïàâí ñî âñåìè êëþ÷àìè â DM âûêëþ÷åí'),
-    ('MSG RESPAWNITEMS ON',            'Respawning items enabled',
-                                       'Ðåñïàâí ïðåäìåòîâ âêëþ÷åí'),
-    ('MSG RESPAWNITEMS OFF',           'Respawning items disabled',
-                                       'Ðåñïàâí ïðåäìåòîâ âûêëþ÷åí'),
     ('MSG BOTSVSPLAYERS ON',           'Bots attack players',
                                        'Áîòû ïðîòèâ èãðîêîâ'),
     ('MSG BOTSVSPLAYERS OFF',          'Bots ignore players',
     ('MSG BOTSVSPLAYERS ON',           'Bots attack players',
                                        'Áîòû ïðîòèâ èãðîêîâ'),
     ('MSG BOTSVSPLAYERS OFF',          'Bots ignore players',
index 62d9337a4f91dc9e3b60aecbbb36ceeacf46a3e1..9f7aaaa4c53ea09180d2972a0f3c4428dba66fa5 100644 (file)
@@ -668,7 +668,6 @@ begin
     gcMaxLives := StrToIntDef(TGUIEdit(GetControl('edMaxLives')).Text, 0);
 
     gcTeamDamage := TGUISwitch(GetControl('swTeamDamage')).ItemIndex = 0;
     gcMaxLives := StrToIntDef(TGUIEdit(GetControl('edMaxLives')).Text, 0);
 
     gcTeamDamage := TGUISwitch(GetControl('swTeamDamage')).ItemIndex = 0;
-    gcRespawnItems := TGUISwitch(GetControl('swRespawnItems')).ItemIndex = 0;
     gcDeathmatchKeys := TGUISwitch(GetControl('swDeathmatchKeys')).ItemIndex = 0;
     gcAllowExit := TGUISwitch(GetControl('swEnableExits')).ItemIndex = 0;
     gcWeaponStay := TGUISwitch(GetControl('swWeaponStay')).ItemIndex = 0;
     gcDeathmatchKeys := TGUISwitch(GetControl('swDeathmatchKeys')).ItemIndex = 0;
     gcAllowExit := TGUISwitch(GetControl('swEnableExits')).ItemIndex = 0;
     gcWeaponStay := TGUISwitch(GetControl('swWeaponStay')).ItemIndex = 0;
@@ -676,8 +675,6 @@ begin
     Options := 0;
     if gcTeamDamage then
       Options := Options or GAME_OPTION_TEAMDAMAGE;
     Options := 0;
     if gcTeamDamage then
       Options := Options or GAME_OPTION_TEAMDAMAGE;
-    if gcRespawnItems then
-      Options := Options or GAME_OPTION_RESPAWNITEMS;
     if gcDeathmatchKeys then
       Options := Options or GAME_OPTION_DMKEYS;
     if gcAllowExit then
     if gcDeathmatchKeys then
       Options := Options or GAME_OPTION_DMKEYS;
     if gcAllowExit then
@@ -738,7 +735,6 @@ begin
     NetPort := StrToIntDef(TGUIEdit(GetControl('edPort')).Text, 0);
 
     gnTeamDamage := TGUISwitch(GetControl('swTeamDamage')).ItemIndex = 0;
     NetPort := StrToIntDef(TGUIEdit(GetControl('edPort')).Text, 0);
 
     gnTeamDamage := TGUISwitch(GetControl('swTeamDamage')).ItemIndex = 0;
-    gnRespawnItems := TGUISwitch(GetControl('swRespawnItems')).ItemIndex = 0;
     gnDeathmatchKeys := TGUISwitch(GetControl('swDeathmatchKeys')).ItemIndex = 0;
     gnAllowExit := TGUISwitch(GetControl('swEnableExits')).ItemIndex = 0;
     gnWeaponStay := TGUISwitch(GetControl('swWeaponStay')).ItemIndex = 0;
     gnDeathmatchKeys := TGUISwitch(GetControl('swDeathmatchKeys')).ItemIndex = 0;
     gnAllowExit := TGUISwitch(GetControl('swEnableExits')).ItemIndex = 0;
     gnWeaponStay := TGUISwitch(GetControl('swWeaponStay')).ItemIndex = 0;
@@ -746,8 +742,6 @@ begin
     Options := 0;
     if gnTeamDamage then
       Options := Options or GAME_OPTION_TEAMDAMAGE;
     Options := 0;
     if gnTeamDamage then
       Options := Options or GAME_OPTION_TEAMDAMAGE;
-    if gnRespawnItems then
-      Options := Options or GAME_OPTION_RESPAWNITEMS;
     if gnDeathmatchKeys then
       Options := Options or GAME_OPTION_DMKEYS;
     if gnAllowExit then
     if gnDeathmatchKeys then
       Options := Options or GAME_OPTION_DMKEYS;
     if gnAllowExit then
@@ -2245,16 +2239,6 @@ begin
       else
         ItemIndex := 1;
     end;
       else
         ItemIndex := 1;
     end;
-    with AddSwitch(_lc[I_MENU_RESPAWN_ITEMS]) do
-    begin
-      Name := 'swRespawnItems';
-      AddItem(_lc[I_MENU_YES]);
-      AddItem(_lc[I_MENU_NO]);
-      if gnRespawnItems then
-        ItemIndex := 0
-      else
-        ItemIndex := 1;
-    end;
     with AddSwitch(_lc[I_MENU_DEATHMATCH_KEYS]) do
     begin
       Name := 'swDeathmatchKeys';
     with AddSwitch(_lc[I_MENU_DEATHMATCH_KEYS]) do
     begin
       Name := 'swDeathmatchKeys';
@@ -2465,16 +2449,6 @@ begin
       else
         ItemIndex := 1;
     end;
       else
         ItemIndex := 1;
     end;
-    with AddSwitch(_lc[I_MENU_RESPAWN_ITEMS]) do
-    begin
-      Name := 'swRespawnItems';
-      AddItem(_lc[I_MENU_YES]);
-      AddItem(_lc[I_MENU_NO]);
-      if gcRespawnItems then
-        ItemIndex := 0
-      else
-        ItemIndex := 1;
-    end;
     with AddSwitch(_lc[I_MENU_DEATHMATCH_KEYS]) do
     begin
       Name := 'swDeathmatchKeys';
     with AddSwitch(_lc[I_MENU_DEATHMATCH_KEYS]) do
     begin
       Name := 'swDeathmatchKeys';
index e89521ddaab4800819bc475058c861fc2bf01c02..23ddc36a259a6a5d04531e64b3ff5243253b8e5a 100644 (file)
@@ -74,7 +74,6 @@ var
   gcMonsters: Boolean;
   gcBotsVS: String;
   gcDeathmatchKeys: Boolean = True;
   gcMonsters: Boolean;
   gcBotsVS: String;
   gcDeathmatchKeys: Boolean = True;
-  gcRespawnItems: Boolean = True;
   gcSpawnInvul: Integer = 0;
   gnMap: String;
   gnGameMode: String;
   gcSpawnInvul: Integer = 0;
   gnMap: String;
   gnGameMode: String;
@@ -88,7 +87,6 @@ var
   gnMonsters: Boolean;
   gnBotsVS: String;
   gnDeathmatchKeys: Boolean = True;
   gnMonsters: Boolean;
   gnBotsVS: String;
   gnDeathmatchKeys: Boolean = True;
-  gnRespawnItems: Boolean = True;
   gnSpawnInvul: Integer = 0;
   gsSDLSampleRate: Integer;
   gsSDLBufferSize: Integer;
   gnSpawnInvul: Integer = 0;
   gsSDLSampleRate: Integer;
   gsSDLBufferSize: Integer;
@@ -294,7 +292,6 @@ begin
   gcMonsters := False;
   gcBotsVS := 'Everybody';
   gcDeathmatchKeys := True;
   gcMonsters := False;
   gcBotsVS := 'Everybody';
   gcDeathmatchKeys := True;
-  gcRespawnItems := True;
   gcSpawnInvul := 0;
 
   (* section GameplayNetwork *)
   gcSpawnInvul := 0;
 
   (* section GameplayNetwork *)
@@ -310,7 +307,6 @@ begin
   gnMonsters := False;
   gnBotsVS := 'Everybody';
   gnDeathmatchKeys := True;
   gnMonsters := False;
   gnBotsVS := 'Everybody';
   gnDeathmatchKeys := True;
-  gnRespawnItems := True;
   gnSpawnInvul := 0;
 
   (* section MasterServer *)
   gnSpawnInvul := 0;
 
   (* section MasterServer *)
@@ -427,7 +423,6 @@ begin
   ReadBoolean(gcMonsters, 'Monsters');
   ReadString(gcBotsVS, 'BotsVS');
   ReadBoolean(gcDeathmatchKeys, 'DeathmatchKeys');
   ReadBoolean(gcMonsters, 'Monsters');
   ReadString(gcBotsVS, 'BotsVS');
   ReadBoolean(gcDeathmatchKeys, 'DeathmatchKeys');
-  ReadBoolean(gcRespawnItems, 'RespawnItems');
   ReadInteger(gcSpawnInvul, 'SpawnInvul');
 
   with gGameSettings do
   ReadInteger(gcSpawnInvul, 'SpawnInvul');
 
   with gGameSettings do
@@ -458,8 +453,6 @@ begin
       Options := Options or GAME_OPTION_BOTVSMONSTER;
     if gcDeathmatchKeys then
       Options := Options or GAME_OPTION_DMKEYS;
       Options := Options or GAME_OPTION_BOTVSMONSTER;
     if gcDeathmatchKeys then
       Options := Options or GAME_OPTION_DMKEYS;
-    if gcRespawnItems then
-      Options := Options or GAME_OPTION_RESPAWNITEMS;
   end;
 
   section := 'GameplayNetwork';
   end;
 
   section := 'GameplayNetwork';
@@ -475,7 +468,6 @@ begin
   ReadBoolean(gnMonsters, 'Monsters');
   ReadString(gnBotsVS, 'BotsVS');
   ReadBoolean(gnDeathmatchKeys, 'DeathmatchKeys');
   ReadBoolean(gnMonsters, 'Monsters');
   ReadString(gnBotsVS, 'BotsVS');
   ReadBoolean(gnDeathmatchKeys, 'DeathmatchKeys');
-  ReadBoolean(gnRespawnItems, 'RespawnItems');
   ReadInteger(gnSpawnInvul, 'SpawnInvul');
 
   section := 'MasterServer';
   ReadInteger(gnSpawnInvul, 'SpawnInvul');
 
   section := 'MasterServer';
@@ -548,7 +540,6 @@ begin
   config.WriteBool('GameplayCustom', 'Monsters', gcMonsters);
   config.WriteStr ('GameplayCustom', 'BotsVS', gcBotsVS);
   config.WriteBool('GameplayCustom', 'DeathmatchKeys', gcDeathmatchKeys);
   config.WriteBool('GameplayCustom', 'Monsters', gcMonsters);
   config.WriteStr ('GameplayCustom', 'BotsVS', gcBotsVS);
   config.WriteBool('GameplayCustom', 'DeathmatchKeys', gcDeathmatchKeys);
-  config.WriteBool('GameplayCustom', 'RespawnItems', gcRespawnItems);
   config.WriteInt ('GameplayCustom', 'SpawnInvul', gcSpawnInvul);
 
   config.WriteStr ('GameplayNetwork', 'Map', gnMap);
   config.WriteInt ('GameplayCustom', 'SpawnInvul', gcSpawnInvul);
 
   config.WriteStr ('GameplayNetwork', 'Map', gnMap);
@@ -563,7 +554,6 @@ begin
   config.WriteBool('GameplayNetwork', 'Monsters', gnMonsters);
   config.WriteStr ('GameplayNetwork', 'BotsVS', gnBotsVS);
   config.WriteBool('GameplayNetwork', 'DeathmatchKeys', gnDeathmatchKeys);
   config.WriteBool('GameplayNetwork', 'Monsters', gnMonsters);
   config.WriteStr ('GameplayNetwork', 'BotsVS', gnBotsVS);
   config.WriteBool('GameplayNetwork', 'DeathmatchKeys', gnDeathmatchKeys);
-  config.WriteBool('GameplayNetwork', 'RespawnItems', gnRespawnItems);
   config.WriteInt ('GameplayNetwork', 'SpawnInvul', gnSpawnInvul);
 
   config.WriteStr('MasterServer', 'IP', NetSlistIP);
   config.WriteInt ('GameplayNetwork', 'SpawnInvul', gnSpawnInvul);
 
   config.WriteStr('MasterServer', 'IP', NetSlistIP);
@@ -612,7 +602,6 @@ begin
   config.WriteBool('GameplayCustom', 'Monsters', gcMonsters);
   config.WriteStr ('GameplayCustom', 'BotsVS', gcBotsVS);
   config.WriteBool('GameplayCustom', 'DeathmatchKeys', gcDeathmatchKeys);
   config.WriteBool('GameplayCustom', 'Monsters', gcMonsters);
   config.WriteStr ('GameplayCustom', 'BotsVS', gcBotsVS);
   config.WriteBool('GameplayCustom', 'DeathmatchKeys', gcDeathmatchKeys);
-  config.WriteBool('GameplayCustom', 'RespawnItems', gcRespawnItems);
   config.WriteInt ('GameplayCustom', 'SpawnInvul', gcSpawnInvul);
 
   config.SaveFile(FileName);
   config.WriteInt ('GameplayCustom', 'SpawnInvul', gcSpawnInvul);
 
   config.SaveFile(FileName);
@@ -639,7 +628,6 @@ begin
   config.WriteBool('GameplayNetwork', 'Monsters', gnMonsters);
   config.WriteStr ('GameplayNetwork', 'BotsVS', gnBotsVS);
   config.WriteBool('GameplayNetwork', 'DeathmatchKeys', gnDeathmatchKeys);
   config.WriteBool('GameplayNetwork', 'Monsters', gnMonsters);
   config.WriteStr ('GameplayNetwork', 'BotsVS', gnBotsVS);
   config.WriteBool('GameplayNetwork', 'DeathmatchKeys', gnDeathmatchKeys);
-  config.WriteBool('GameplayNetwork', 'RespawnItems', gnRespawnItems);
   config.WriteInt ('GameplayNetwork', 'SpawnInvul', gnSpawnInvul);
 
   config.SaveFile(FileName);
   config.WriteInt ('GameplayNetwork', 'SpawnInvul', gnSpawnInvul);
 
   config.SaveFile(FileName);