REPLICATE(cvar_cl_allow_uid2name, bool, "cl_allow_uid2name");
+REPLICATE(cvar_cl_allow_uidranking, bool, "cl_allow_uidranking");
+
REPLICATE(cvar_cl_autoscreenshot, int, "cl_autoscreenshot");
REPLICATE(cvar_cl_autotaunt, float, "cl_autotaunt");
REPLICATE(cvar_cl_handicap, float, "cl_handicap");
+REPLICATE(cvar_cl_gunalign, int, "cl_gunalign");
+
REPLICATE(cvar_cl_jetpack_jump, bool, "cl_jetpack_jump");
REPLICATE(cvar_cl_movement_track_canjump, bool, "cl_movement_track_canjump");
{
string s = string_null;
+ if (f == 0)
+ LOG_INFO("Warning: requesting cvar values is deprecated. Client should send them automatically using REPLICATE.\n");
+
if (f > 0)
s = strcat1(argv(f));
allow_mutatorblocked = M_ARGV(3, bool);
if(allguns)
- d = boolean((weaponinfo.spawnflags & WEP_FLAG_NORMAL) && !(weaponinfo.spawnflags & WEP_FLAG_HIDDEN));
+ d = boolean((weaponinfo.spawnflags & WEP_FLAG_NORMAL) && !(weaponinfo.spawnflags & (WEP_FLAG_HIDDEN | WEP_FLAG_SPECIALATTACK)));
else if(!mutator_returnvalue)
d = !(!weaponinfo.weaponstart);
{
WepSet ret = '0 0 0';
FOREACH(Weapons, it != WEP_Null, {
- int w = want_weapon(it, false); // TODO too complicated? see my MR, test CTS/courtfun - ballstealer
- if(w & 1)
+ int w = want_weapon(it, false);
+ if (w & 1)
ret |= it.m_wepset;
});
return ret;
{
WepSet ret = '0 0 0';
FOREACH(Weapons, it != WEP_Null, {
- if(!(it.spawnflags & WEP_FLAG_MUTATORBLOCKED))
+ if (!(it.spawnflags & (WEP_FLAG_MUTATORBLOCKED | WEP_FLAG_SPECIALATTACK)))
ret |= it.m_wepset;
});
return ret;
{
WepSet ret = '0 0 0';
FOREACH(Weapons, it != WEP_Null, {
- if(!(it.spawnflags & WEP_FLAG_MUTATORBLOCKED) && (it.spawnflags & WEP_FLAG_NORMAL) && !(it.spawnflags & WEP_FLAG_HIDDEN))
+ if ((it.spawnflags & WEP_FLAG_NORMAL) && !(it.spawnflags & (WEP_FLAG_MUTATORBLOCKED | WEP_FLAG_HIDDEN | WEP_FLAG_SPECIALATTACK)))
ret |= it.m_wepset;
});
return ret;
{
// no arena
}
- else if (s == "off") // TODO remove? CA and others don't respect this
+ else if (s == "off")
{
// forcibly turn off weaponarena
}
{
g_weapon_stay = 0; // incompatible
start_weapons = g_weaponarena_weapons;
- start_items |= IT_UNLIMITED_AMMO;
+ start_items |= IT_UNLIMITED_AMMO | IT_UNLIMITED_SUPERWEAPONS;
}
else
{
if(!cvar("g_use_ammunition"))
start_items |= IT_UNLIMITED_AMMO;
- if(start_items & IT_UNLIMITED_WEAPON_AMMO)
+ if(start_items & IT_UNLIMITED_AMMO)
{
start_ammo_shells = 999;
start_ammo_nails = 999;
start_ammo_plasma = cvar("g_start_ammo_plasma");
start_ammo_fuel = cvar("g_start_ammo_fuel");
random_start_weapons_count = cvar("g_random_start_weapons_count");
- SetResource(random_start_ammo, RES_SHELLS, cvar(
- "g_random_start_shells"));
- SetResource(random_start_ammo, RES_BULLETS, cvar(
- "g_random_start_bullets"));
- SetResource(random_start_ammo, RES_ROCKETS,
- cvar("g_random_start_rockets"));
- SetResource(random_start_ammo, RES_CELLS, cvar(
- "g_random_start_cells"));
- SetResource(random_start_ammo, RES_PLASMA, cvar(
- "g_random_start_plasma"));
+ SetResource(random_start_ammo, RES_SHELLS, cvar("g_random_start_shells"));
+ SetResource(random_start_ammo, RES_BULLETS, cvar("g_random_start_bullets"));
+ SetResource(random_start_ammo, RES_ROCKETS,cvar("g_random_start_rockets"));
+ SetResource(random_start_ammo, RES_CELLS, cvar("g_random_start_cells"));
+ SetResource(random_start_ammo, RES_PLASMA, cvar("g_random_start_plasma"));
}
warmup_start_ammo_shells = start_ammo_shells;
start_ammo_cells = max(0, start_ammo_cells);
start_ammo_plasma = max(0, start_ammo_plasma);
start_ammo_fuel = max(0, start_ammo_fuel);
- SetResource(random_start_ammo, RES_SHELLS, max(0,
- GetResource(random_start_ammo, RES_SHELLS)));
- SetResource(random_start_ammo, RES_BULLETS, max(0,
- GetResource(random_start_ammo, RES_BULLETS)));
- SetResource(random_start_ammo, RES_ROCKETS, max(0,
- GetResource(random_start_ammo, RES_ROCKETS)));
- SetResource(random_start_ammo, RES_CELLS, max(0,
- GetResource(random_start_ammo, RES_CELLS)));
- SetResource(random_start_ammo, RES_PLASMA, max(0,
- GetResource(random_start_ammo, RES_PLASMA)));
+ SetResource(random_start_ammo, RES_SHELLS,
+ max(0, GetResource(random_start_ammo, RES_SHELLS)));
+ SetResource(random_start_ammo, RES_BULLETS,
+ max(0, GetResource(random_start_ammo, RES_BULLETS)));
+ SetResource(random_start_ammo, RES_ROCKETS,
+ max(0, GetResource(random_start_ammo, RES_ROCKETS)));
+ SetResource(random_start_ammo, RES_CELLS,
+ max(0, GetResource(random_start_ammo, RES_CELLS)));
+ SetResource(random_start_ammo, RES_PLASMA,
+ max(0, GetResource(random_start_ammo, RES_PLASMA)));
warmup_start_ammo_shells = max(0, warmup_start_ammo_shells);
warmup_start_ammo_nails = max(0, warmup_start_ammo_nails);
return false; // no checks here
else if(this.classname == "grapplinghook")
RemoveHook(this);
- else if(this.classname == "spike")
- {
- W_Crylink_Dequeue(this);
- delete(this);
- }
else
delete(this);
return true;
return s;
}
-float MoveToRandomLocationWithinBounds(entity e, vector boundmin, vector boundmax, float goodcontents, float badcontents, float badsurfaceflags, float attempts, float maxaboveground, float minviewdistance)
+bool MoveToRandomLocationWithinBounds(entity e, vector boundmin, vector boundmax, float goodcontents, float badcontents, float badsurfaceflags, int attempts, float maxaboveground, float minviewdistance, bool frompos)
{
float m, i;
vector start, org, delta, end, enddown, mstart;
// rule 4: we must "see" some spawnpoint or item
entity sp = NULL;
- IL_EACH(g_spawnpoints, checkpvs(mstart, it),
+ if(frompos)
{
- if((traceline(mstart, it.origin, MOVE_NORMAL, e), trace_fraction) >= 1)
- {
- sp = it;
- break;
- }
- });
+ if((traceline(mstart, e.origin, MOVE_NORMAL, e), trace_fraction) >= 1)
+ sp = e;
+ }
+ if(!sp)
+ {
+ IL_EACH(g_spawnpoints, checkpvs(mstart, it),
+ {
+ if((traceline(mstart, it.origin, MOVE_NORMAL, e), trace_fraction) >= 1)
+ {
+ sp = it;
+ break;
+ }
+ });
+ }
if(!sp)
{
int items_checked = 0;
return false;
}
-float MoveToRandomMapLocation(entity e, float goodcontents, float badcontents, float badsurfaceflags, float attempts, float maxaboveground, float minviewdistance)
+bool MoveToRandomMapLocation(entity e, float goodcontents, float badcontents, float badsurfaceflags, int attempts, float maxaboveground, float minviewdistance)
{
- return MoveToRandomLocationWithinBounds(e, world.mins, world.maxs, goodcontents, badcontents, badsurfaceflags, attempts, maxaboveground, minviewdistance);
+ return MoveToRandomLocationWithinBounds(e, world.mins, world.maxs, goodcontents, badcontents, badsurfaceflags, attempts, maxaboveground, minviewdistance, false);
}
void write_recordmarker(entity pl, float tstart, float dt)