From: bones_was_here Date: Mon, 13 Jul 2020 09:40:13 +0000 (+1000) Subject: Remove sv_q3acompat_machineshotgunswap and move .arena file check to quake3.qc X-Git-Tag: xonotic-v0.8.5~352^2~73 X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=86a9fda8a03ef2cbcdaecd0d25e46538f8560975;p=xonotic%2Fxonotic-data.pk3dir.git Remove sv_q3acompat_machineshotgunswap and move .arena file check to quake3.qc --- diff --git a/qcsrc/common/weapons/weapon/shockwave.qc b/qcsrc/common/weapons/weapon/shockwave.qc index f38c34b19..4ee49f83b 100644 --- a/qcsrc/common/weapons/weapon/shockwave.qc +++ b/qcsrc/common/weapons/weapon/shockwave.qc @@ -3,18 +3,6 @@ REGISTER_NET_TEMP(TE_CSQC_SHOCKWAVEPARTICLE) #ifdef SVQC -// enable when shockwave replaces shotgun -#if 0 -METHOD(Shockwave, m_spawnfunc_hookreplace, Weapon(Shockwave this, entity e)) -{ - //if(autocvar_sv_q3acompat_machineshockwaveswap) // WEAPONTODO - if (autocvar_sv_q3acompat_machineshotgunswap && !Item_IsLoot(e)) - { - return WEP_MACHINEGUN; - } - return this; -} -#endif const float MAX_SHOCKWAVE_HITS = 10; //#define DEBUG_SHOCKWAVE diff --git a/qcsrc/server/autocvars.qh b/qcsrc/server/autocvars.qh index 99077dcfe..6c14aa795 100644 --- a/qcsrc/server/autocvars.qh +++ b/qcsrc/server/autocvars.qh @@ -327,7 +327,6 @@ float autocvar_sv_maxspeed; string autocvar_sv_motd; int autocvar_sv_name_maxlength = 64; bool autocvar_sv_precacheplayermodels; -bool autocvar_sv_q3acompat_machineshotgunswap; bool autocvar_sv_servermodelsonly; int autocvar_sv_spectate; float autocvar_sv_spectator_speed_multiplier; diff --git a/qcsrc/server/compat/quake3.qc b/qcsrc/server/compat/quake3.qc index d90b3385a..03f5580d6 100644 --- a/qcsrc/server/compat/quake3.qc +++ b/qcsrc/server/compat/quake3.qc @@ -16,13 +16,19 @@ //*********************** // NOTE: for best experience, you need to swap MGs with SGs in the map or it won't have a MG +bool q3compat_arena(string mapname) +{ + if(fexists(strcat("scripts/", mapname, ".arena"))) return true; + + return false; +} // SG -> MG || SG -SPAWNFUNC_ITEM_COND(ammo_shells, autocvar_sv_q3acompat_machineshotgunswap, ITEM_Bullets, ITEM_Shells) -SPAWNFUNC_WEAPON_COND(weapon_shotgun, autocvar_sv_q3acompat_machineshotgunswap, WEP_MACHINEGUN, WEP_SHOTGUN) +SPAWNFUNC_ITEM_COND(ammo_shells, q3compat_arena(mapname), ITEM_Bullets, ITEM_Shells) +SPAWNFUNC_WEAPON_COND(weapon_shotgun, q3compat_arena(mapname), WEP_MACHINEGUN, WEP_SHOTGUN) // MG -> SG || MG -SPAWNFUNC_ITEM_COND(ammo_bullets, autocvar_sv_q3acompat_machineshotgunswap, ITEM_Shells, ITEM_Bullets) +SPAWNFUNC_ITEM_COND(ammo_bullets, q3compat_arena(mapname), ITEM_Shells, ITEM_Bullets) // GL -> Mortar SPAWNFUNC_ITEM(ammo_grenades, ITEM_Rockets) @@ -36,7 +42,7 @@ SPAWNFUNC_WEAPON(weapon_chaingun, WEP_HLAC) SPAWNFUNC_ITEM(ammo_belt, ITEM_Cells) // Team Arena Nailgun -> Crylink || Quake Nailgun -> Electro -SPAWNFUNC_WEAPON_COND(weapon_nailgun, autocvar_sv_q3acompat_machineshotgunswap, WEP_CRYLINK, WEP_ELECTRO) +SPAWNFUNC_WEAPON_COND(weapon_nailgun, q3compat_arena(mapname), WEP_CRYLINK, WEP_ELECTRO) SPAWNFUNC_ITEM(ammo_nails, ITEM_Cells) // LG -> Electro @@ -277,7 +283,8 @@ bool DoesQ3ARemoveThisEntity(entity this) // DeFRaG mappers use "notcpm" or "notvq3" to disable an entity in CPM or VQ3 physics // Xonotic is usually played with a CPM-based physics so we default to CPM mode - if(cvar_string("g_mod_physics") == "Q3") { + if(cvar_string("g_mod_physics") == "Q3") + { if(this.notvq3) return true; } else if(this.notcpm) return true; diff --git a/qcsrc/server/compat/quake3.qh b/qcsrc/server/compat/quake3.qh index 20e4879d9..eb77acd1e 100644 --- a/qcsrc/server/compat/quake3.qh +++ b/qcsrc/server/compat/quake3.qh @@ -1,5 +1,6 @@ #pragma once +bool q3compat_arena(string mapname); bool DoesQ3ARemoveThisEntity(entity this); .int fragsfilter_cnt; diff --git a/qcsrc/server/g_world.qc b/qcsrc/server/g_world.qc index 48da1b5dc..884e6c3be 100644 --- a/qcsrc/server/g_world.qc +++ b/qcsrc/server/g_world.qc @@ -878,9 +878,6 @@ spawnfunc(worldspawn) MapInfo_Enumerate(); MapInfo_FilterGametype(MapInfo_CurrentGametype(), MapInfo_CurrentFeatures(), MapInfo_RequiredFlags(), MapInfo_ForbiddenFlags(), 1); - if(fexists(strcat("scripts/", mapname, ".arena"))) - cvar_settemp("sv_q3acompat_machineshotgunswap", "1"); - if(fexists(strcat("scripts/", mapname, ".defi"))) cvar_settemp("sv_q3defragcompat", "1"); diff --git a/xonotic-server.cfg b/xonotic-server.cfg index 094f17b00..6f26e726f 100644 --- a/xonotic-server.cfg +++ b/xonotic-server.cfg @@ -494,7 +494,6 @@ sv_gameplayfix_consistentplayerprethink 1 sv_gameplayfix_gravityunaffectedbyticrate 1 sv_gameplayfix_nogravityonground 1 -set sv_q3acompat_machineshotgunswap 0 "shorthand for swapping machinegun and shotgun (for Q3A map compatibility in mapinfo files)" set sv_q3defragcompat 0 "toggle for some compatibility hacks (for Q3DF map compatibility)" set g_movement_highspeed 1 "multiplier scale for movement speed (applies to sv_maxspeed and sv_maxairspeed, also applies to air acceleration when g_movement_highspeed_q3_compat is set to 0)"