From 0b34f8195a84d9aecc7cd9f17fd1902b7723e3b8 Mon Sep 17 00:00:00 2001 From: fgsfds Date: Mon, 24 Feb 2020 18:55:48 +0300 Subject: [PATCH] nuke g_respawn_items --- src/game/g_console.pas | 2 -- src/game/g_game.pas | 22 ---------------------- src/game/g_items.pas | 8 ++++---- src/game/g_language.pas | 12 +++--------- src/game/g_menu.pas | 26 -------------------------- src/game/g_options.pas | 12 ------------ 6 files changed, 7 insertions(+), 75 deletions(-) diff --git a/src/game/g_console.pas b/src/game/g_console.pas index 01cd41a..94b6531 100644 --- a/src/game/g_console.pas +++ b/src/game/g_console.pas @@ -929,7 +929,6 @@ begin 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); @@ -1036,7 +1035,6 @@ begin WhitelistCommand('g_scorelimit'); WhitelistCommand('g_timelimit'); WhitelistCommand('g_dm_keys'); - WhitelistCommand('g_respawn_items'); WhitelistCommand('g_spawn_invul'); WhitelistCommand('g_warmuptime'); diff --git a/src/game/g_game.pas b/src/game/g_game.pas index feaf159..0395bf4 100644 --- a/src/game/g_game.pas +++ b/src/game/g_game.pas @@ -180,7 +180,6 @@ const GAME_OPTION_BOTVSPLAYER = 32; GAME_OPTION_BOTVSMONSTER = 64; GAME_OPTION_DMKEYS = 128; - GAME_OPTION_RESPAWNITEMS = 256; STATE_NONE = 0; STATE_MENU = 1; @@ -5557,27 +5556,6 @@ begin 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 diff --git a/src/game/g_items.pas b/src/game/g_items.pas index ae047f8..9693ad0 100644 --- a/src/game/g_items.pas +++ b/src/game/g_items.pas @@ -509,7 +509,6 @@ var Anim: TAnimation; m: Word; r, nxt: Boolean; - actualRespawnable: Boolean; begin if (ggItems = nil) then exit; @@ -577,9 +576,10 @@ 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; diff --git a/src/game/g_language.pas b/src/game/g_language.pas index 09021f5..8d5ea09 100644 --- a/src/game/g_language.pas +++ b/src/game/g_language.pas @@ -162,7 +162,7 @@ type 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, @@ -575,8 +575,6 @@ type 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, @@ -924,8 +922,8 @@ const 'Æèçíè:'), ('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:', @@ -1711,10 +1709,6 @@ const 'Ðåñïàâí ñî âñåìè êëþ÷àìè â 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', diff --git a/src/game/g_menu.pas b/src/game/g_menu.pas index 62d9337..9f7aaaa 100644 --- a/src/game/g_menu.pas +++ b/src/game/g_menu.pas @@ -668,7 +668,6 @@ begin 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; @@ -676,8 +675,6 @@ begin 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 @@ -738,7 +735,6 @@ begin 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; @@ -746,8 +742,6 @@ begin 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 @@ -2245,16 +2239,6 @@ begin 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'; @@ -2465,16 +2449,6 @@ begin 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'; diff --git a/src/game/g_options.pas b/src/game/g_options.pas index e89521d..23ddc36 100644 --- a/src/game/g_options.pas +++ b/src/game/g_options.pas @@ -74,7 +74,6 @@ var gcMonsters: Boolean; gcBotsVS: String; gcDeathmatchKeys: Boolean = True; - gcRespawnItems: Boolean = True; gcSpawnInvul: Integer = 0; gnMap: String; gnGameMode: String; @@ -88,7 +87,6 @@ var gnMonsters: Boolean; gnBotsVS: String; gnDeathmatchKeys: Boolean = True; - gnRespawnItems: Boolean = True; gnSpawnInvul: Integer = 0; gsSDLSampleRate: Integer; gsSDLBufferSize: Integer; @@ -294,7 +292,6 @@ begin gcMonsters := False; gcBotsVS := 'Everybody'; gcDeathmatchKeys := True; - gcRespawnItems := True; gcSpawnInvul := 0; (* section GameplayNetwork *) @@ -310,7 +307,6 @@ begin gnMonsters := False; gnBotsVS := 'Everybody'; gnDeathmatchKeys := True; - gnRespawnItems := True; gnSpawnInvul := 0; (* section MasterServer *) @@ -427,7 +423,6 @@ begin ReadBoolean(gcMonsters, 'Monsters'); ReadString(gcBotsVS, 'BotsVS'); ReadBoolean(gcDeathmatchKeys, 'DeathmatchKeys'); - ReadBoolean(gcRespawnItems, 'RespawnItems'); 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; - if gcRespawnItems then - Options := Options or GAME_OPTION_RESPAWNITEMS; end; section := 'GameplayNetwork'; @@ -475,7 +468,6 @@ begin ReadBoolean(gnMonsters, 'Monsters'); ReadString(gnBotsVS, 'BotsVS'); ReadBoolean(gnDeathmatchKeys, 'DeathmatchKeys'); - ReadBoolean(gnRespawnItems, 'RespawnItems'); 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', 'RespawnItems', gcRespawnItems); 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', 'RespawnItems', gnRespawnItems); 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', 'RespawnItems', gcRespawnItems); 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', 'RespawnItems', gnRespawnItems); config.WriteInt ('GameplayNetwork', 'SpawnInvul', gnSpawnInvul); config.SaveFile(FileName); -- 2.29.2