if (!this.lip)
this.lip = 4;
- if(this.wait == -1 && autocvar_sv_q3defragcompat)
- this.wait = 0.1; // compatibility for q3df: "instant" return
+ if(this.wait < 0 && q3compat)
+ this.wait = 0.1; // compatibility for q3: -1 = return immediately
if(this.noise != "")
precache_sound(this.noise);
}
else if (!this.speed)
{
- if (autocvar_sv_q3defragcompat)
+ if (q3compat)
this.speed = 400;
else
this.speed = 100;
if (toucher.triggerhurttime < time)
{
EXACTTRIGGER_TOUCH(this, toucher);
- toucher.triggerhurttime = time + ((autocvar_sv_q3defragcompat && !(this.spawnflags & HURT_SLOW)) ? 0.1 : 1);
+ toucher.triggerhurttime = time + ((q3compat && !(this.spawnflags & HURT_SLOW)) ? 0.1 : 1);
entity own;
own = this.enemy;
this.use = trigger_hurt_use;
this.enemy = world; // I hate you all
if (!this.dmg)
- this.dmg = ((autocvar_sv_q3defragcompat) ? 5 : 10000);
+ this.dmg = ((q3compat) ? 5 : 10000);
if (this.message == "")
this.message = "was in the wrong place";
if (this.message2 == "")
vector org = targ.origin;
#ifdef SVQC
- if(autocvar_sv_q3defragcompat)
+ if(q3compat)
#elif defined(CSQC)
if(STAT(Q3DEFRAGCOMPAT))
#endif
this.wait = 0;
this.use = multi_use;
- if(this.wait == -1 && autocvar_sv_q3defragcompat)
+ if(this.wait == -1 && q3compat & BIT(1))
this.wait = 0.1; // compatibility for q3df: "instant" return
EXACTTRIGGER_INIT;
: 0;
STAT(MOVEVARS_AIRSPEEDLIMIT_NONQW, this) = Physics_ClientOption(this, "airspeedlimit_nonqw", autocvar_sv_airspeedlimit_nonqw) * maxspd_mod;
}
- bool q3dfcompat = autocvar_sv_q3defragcompat && autocvar_sv_q3defragcompat_changehitbox; // NOTE: these hitboxes are off by 1 due to engine differences
+ bool q3dfcompat = q3compat && autocvar_sv_q3defragcompat_changehitbox; // NOTE: these hitboxes are off by 1 due to engine differences
STAT(PL_MIN, this) = (q3dfcompat) ? '-15 -15 -20' : autocvar_sv_player_mins;
STAT(PL_MAX, this) = (q3dfcompat) ? '15 15 36' : autocvar_sv_player_maxs;
STAT(PL_VIEW_OFS, this) = (q3dfcompat) ? '0 0 30' : autocvar_sv_player_viewoffset;
#ifdef SVQC
#include <server/autocvars.qh>
#include <server/client.qh>
+#include <server/compat/quake3.qh>
#endif
// Full list of all stat constants, included in a single location for easy reference
#endif
REGISTER_STAT(SLICK_APPLYGRAVITY, bool, autocvar_sv_slick_applygravity)
-#ifdef SVQC
-bool autocvar_sv_q3defragcompat;
-#endif
-REGISTER_STAT(Q3DEFRAGCOMPAT, bool, autocvar_sv_q3defragcompat)
+REGISTER_STAT(Q3DEFRAGCOMPAT, bool, q3compat)
#ifdef SVQC
#include "physics/movetypes/movetypes.qh"
this.respawn_flags = 0;
this.respawn_time = 0;
STAT(RESPAWN_TIME, this) = 0;
- bool q3dfcompat = autocvar_sv_q3defragcompat && autocvar_sv_q3defragcompat_changehitbox;
+ bool q3dfcompat = q3compat && autocvar_sv_q3defragcompat_changehitbox;
this.scale = ((q3dfcompat) ? 0.9 : autocvar_sv_player_scale);
this.fade_time = 0;
this.pain_frame = 0;
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, q3compat_arena(mapname), ITEM_Bullets, ITEM_Shells)
-SPAWNFUNC_WEAPON_COND(weapon_shotgun, q3compat_arena(mapname), WEP_MACHINEGUN, WEP_SHOTGUN)
+SPAWNFUNC_ITEM_COND(ammo_shells, q3compat & BIT(0), ITEM_Bullets, ITEM_Shells)
+SPAWNFUNC_WEAPON_COND(weapon_shotgun, q3compat & BIT(0), WEP_MACHINEGUN, WEP_SHOTGUN)
// MG -> SG || MG
-SPAWNFUNC_ITEM_COND(ammo_bullets, q3compat_arena(mapname), ITEM_Shells, ITEM_Bullets)
+SPAWNFUNC_ITEM_COND(ammo_bullets, q3compat & BIT(0), ITEM_Shells, ITEM_Bullets)
// GL -> Mortar
SPAWNFUNC_ITEM(ammo_grenades, ITEM_Rockets)
SPAWNFUNC_ITEM(ammo_belt, ITEM_Cells)
// Team Arena Nailgun -> Crylink || Quake Nailgun -> Electro
-SPAWNFUNC_WEAPON_COND(weapon_nailgun, q3compat_arena(mapname), WEP_CRYLINK, WEP_ELECTRO)
+SPAWNFUNC_WEAPON_COND(weapon_nailgun, q3compat & BIT(0), WEP_CRYLINK, WEP_ELECTRO)
SPAWNFUNC_ITEM(ammo_nails, ITEM_Cells)
// LG -> Electro
// Xonotic is usually played with a CPM-based physics so we default to CPM mode
if(cvar_string("g_mod_physics") == "Q3")
{
- if(this.notvq3) return true;
+ if(this.notvq3)
+ return true;
}
- else if(this.notcpm) return true;
+ else if(this.notcpm)
+ return true;
// Q3 mappers use "notq3a" or "notta" to disable an entity in Q3A or Q3TA
// Xonotic has ~equivalent features to Team Arena
#pragma once
-bool q3compat_arena(string mapname);
+int q3compat = 0;
bool DoesQ3ARemoveThisEntity(entity this);
.int fragsfilter_cnt;
MapInfo_Enumerate();
MapInfo_FilterGametype(MapInfo_CurrentGametype(), MapInfo_CurrentFeatures(), MapInfo_RequiredFlags(), MapInfo_ForbiddenFlags(), 1);
- if(fexists(strcat("scripts/", mapname, ".defi")))
- cvar_settemp("sv_q3defragcompat", "1");
+ q3compat = BITSET(q3compat, BIT(0), fexists(strcat("scripts/", mapname, ".arena")));
+ q3compat = BITSET(q3compat, BIT(1), fexists(strcat("scripts/", mapname, ".defi")));
+ LOG_INFO("CHECKED FOR: scripts/", mapname, ".arena and scripts/", mapname, ".defi, q3compat set to ", ftos(q3compat));
if(whichpack(strcat("maps/", mapname, ".cfg")) != "")
{
sv_gameplayfix_gravityunaffectedbyticrate 1
sv_gameplayfix_nogravityonground 1
-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)"
set g_movement_highspeed_q3_compat 0 "apply speed modifiers to air movement in a more Q3-compatible way (only apply speed buffs and g_movement_highspeed to max air speed, not to acceleration)"