Commit 22a952ce authored by terencehill's avatar terencehill

Merge branch 'master' into terencehill/ft_autorevive_progress

parents 9809a50b d9ddf453
Pipeline #33925846 passed with stage
in 15 minutes and 48 seconds
......@@ -29,7 +29,7 @@ test_sv_game:
- wget -O data/maps/stormkeep.waypoints https://gitlab.com/xonotic/xonotic-maps.pk3dir/raw/master/maps/stormkeep.waypoints
- wget -O data/maps/stormkeep.waypoints.cache https://gitlab.com/xonotic/xonotic-maps.pk3dir/raw/master/maps/stormkeep.waypoints.cache
- make
- EXPECT=c2ae476e90317feda0756669a21ce1e7
- EXPECT=bb534e81ce09934ceadfd952a8ecd016
- HASH=$(${ENGINE} -noconfig -nohome +exec serverbench.cfg
| tee /dev/stderr
| grep '^:'
......
......@@ -159,11 +159,11 @@ seta hud_damage_pain_threshold_lower_health 50 "at which health we start lowerin
seta hud_damage_pain_threshold_pulsating_min 0.6 "minimum value when calculating the pulse: max(pulsating_min, fabs(sin(PI * time / period))"
seta hud_damage_pain_threshold_pulsating_period 0.8 "one pulse every X seconds"
seta hud_powerup 0 "power of the sharpen effect when owning the shield or strength powerups, default is 0.5"
seta hud_powerup 0 "power of the sharpen effect when owning the shield or strength powerups"
seta hud_postprocessing 1 "enables the ability for effects such as hud_damage_blur and hud_contents to apply a postprocessing method upon the screen - enabling this disables manual editing of the postprocess cvars"
seta hud_postprocessing_maxbluralpha 0 "maximum alpha which the blur postprocess can be, default is 0.5"
seta hud_postprocessing_maxblurradius 8 "maximum radius which the blur postprocess can be, default is 8"
seta hud_postprocessing_maxbluralpha 0 "maximum alpha which the blur postprocess can be"
seta hud_postprocessing_maxblurradius 8 "maximum radius which the blur postprocess can be"
seta hud_contents 1 "an improved version of gl_polyblend for liquids such as water/lava/slime, draw a filler when inside the liquid"
seta hud_contents_blur 10 "Use postprocessing to blur the screen when you are inside a liquid. Higher values = more blur"
......
......@@ -60,8 +60,8 @@ set g_balance_shotgun_secondary_alt_animtime 0.2
set g_balance_shotgun_secondary_alt_refire 1.2
set g_balance_shotgun_switchdelay_drop 0.2
set g_balance_shotgun_switchdelay_raise 0.2
set g_balance_shotgun_weaponreplace "shockwave"
set g_balance_shotgun_weaponstart 0
set g_balance_shotgun_weaponreplace ""
set g_balance_shotgun_weaponstart 1
set g_balance_shotgun_weaponstartoverride -1
set g_balance_shotgun_weaponthrowable 1
// }}}
......@@ -260,9 +260,9 @@ set g_balance_crylink_secondary_ammo 3
set g_balance_crylink_secondary_animtime 0.2
set g_balance_crylink_secondary_bouncedamagefactor 0.5
set g_balance_crylink_secondary_bounces 0
set g_balance_crylink_secondary_damage 50
set g_balance_crylink_secondary_edgedamage 15
set g_balance_crylink_secondary_force -400
set g_balance_crylink_secondary_damage 10
set g_balance_crylink_secondary_edgedamage 5
set g_balance_crylink_secondary_force -200
set g_balance_crylink_secondary_joindelay 0
set g_balance_crylink_secondary_joinexplode 0
set g_balance_crylink_secondary_joinexplode_damage 0
......@@ -270,17 +270,17 @@ set g_balance_crylink_secondary_joinexplode_edgedamage 0
set g_balance_crylink_secondary_joinexplode_force 0
set g_balance_crylink_secondary_joinexplode_radius 0
set g_balance_crylink_secondary_joinspread 0
set g_balance_crylink_secondary_linkexplode 1
set g_balance_crylink_secondary_linkexplode 0
set g_balance_crylink_secondary_middle_fadetime 5
set g_balance_crylink_secondary_middle_lifetime 5
set g_balance_crylink_secondary_other_fadetime 5
set g_balance_crylink_secondary_other_lifetime 5
set g_balance_crylink_secondary_radius 70
set g_balance_crylink_secondary_refire 0.8
set g_balance_crylink_secondary_shots 1
set g_balance_crylink_secondary_speed 3000
set g_balance_crylink_secondary_spread 0
set g_balance_crylink_secondary_spreadtype 1
set g_balance_crylink_secondary_other_fadetime 2
set g_balance_crylink_secondary_other_lifetime 2
set g_balance_crylink_secondary_radius 100
set g_balance_crylink_secondary_refire 0.65
set g_balance_crylink_secondary_shots 5
set g_balance_crylink_secondary_speed 7000
set g_balance_crylink_secondary_spread 0.08
set g_balance_crylink_secondary_spreadtype 0
set g_balance_crylink_switchdelay_drop 0.2
set g_balance_crylink_switchdelay_raise 0.2
set g_balance_crylink_weaponreplace ""
......@@ -725,7 +725,7 @@ set g_balance_shockwave_melee_traces 10
set g_balance_shockwave_switchdelay_drop 0.2
set g_balance_shockwave_switchdelay_raise 0.2
set g_balance_shockwave_weaponreplace ""
set g_balance_shockwave_weaponstart 1
set g_balance_shockwave_weaponstart 0
set g_balance_shockwave_weaponstartoverride -1
set g_balance_shockwave_weaponthrowable 0
// }}}
......@@ -753,10 +753,10 @@ set g_balance_arc_beam_heat 0
set g_balance_arc_burst_heat 5
set g_balance_arc_beam_maxangle 10
set g_balance_arc_beam_nonplayerdamage 80
set g_balance_arc_beam_range 1250
set g_balance_arc_beam_range 1500
set g_balance_arc_beam_refire 0.25
set g_balance_arc_beam_returnspeed 8
set g_balance_arc_beam_tightness 0.5
set g_balance_arc_beam_tightness 0.6
set g_balance_arc_bolt 1
set g_balance_arc_bolt_ammo 1
set g_balance_arc_bolt_damage 25
......@@ -883,7 +883,7 @@ set g_balance_okmachinegun_primary_ammo 1
set g_balance_okmachinegun_primary_damage 25
set g_balance_okmachinegun_primary_force 5
set g_balance_okmachinegun_primary_refire 0.1
set g_balance_okmachinegun_primary_solidpenetration 13.1
set g_balance_okmachinegun_primary_solidpenetration 63
set g_balance_okmachinegun_primary_spread_add 0.012
set g_balance_okmachinegun_primary_spread_max 0.05
set g_balance_okmachinegun_primary_spread_min 0
......
......@@ -9,7 +9,7 @@ cl_playerdetailreduction 4
gl_flashblend 0
gl_picmip 0
gl_texturecompression_2d 0
gl_texturecompression_sky 1
gl_texturecompression_sky 0
mod_q3bsp_nolightmaps 0
r_bloom 0
r_coronas 1
......
......@@ -318,6 +318,7 @@ set g_cts 0 "CTS: complete the stage"
set g_cts_selfdamage 1 "0 = disable all selfdamage and falldamage in cts"
set g_cts_finish_kill_delay 10 "prevent cheating by running back to the start line, and starting out with more speed than otherwise possible"
set g_cts_send_rankings_cnt 15 "send this number of map records to clients"
set g_cts_removeprojectiles 0 "remove projectiles when the player dies, to prevent using weapons earlier in the stage than intended"
// ==========================
......@@ -541,5 +542,5 @@ set g_invasion_type 0 "type of invasion mode - 0: round-based, 1: hunting, 2: co
// duel
// ======
set g_duel 0 "Duel: frag the opponent more in a one versus one arena battle"
set g_duel_warmup 1 "Have a short warmup period before beginning the actual duel"
//set g_duel_warmup 180 "Have a short warmup period before beginning the actual duel"
set g_duel_with_powerups 0 "Enable powerups to spawn in the duel gamemode"
......@@ -118,7 +118,7 @@ void HUD_InfoMessages()
MUTATOR_CALLHOOK(DrawInfoMessages, pos, mySize);
if(!warmup_stage && gametype == MAPINFO_TYPE_LMS)
if(!warmup_stage && ISGAMETYPE(LMS))
{
entity sk;
sk = playerslots[player_localnum];
......
......@@ -54,9 +54,9 @@ void HUD_Mod_CA(vector myPos, vector mySize)
mod_active = 1; // required in each mod function that always shows something
int layout;
if(gametype == MAPINFO_TYPE_CA)
if(ISGAMETYPE(CA))
layout = autocvar_hud_panel_modicons_ca_layout;
else //if(gametype == MAPINFO_TYPE_FREEZETAG)
else //if(ISGAMETYPE(FREEZETAG))
layout = autocvar_hud_panel_modicons_freezetag_layout;
int rows, columns;
float aspect_ratio;
......@@ -528,7 +528,7 @@ void HUD_Mod_Race(vector pos, vector mySize)
// clientside personal record
string rr;
if(gametype == MAPINFO_TYPE_CTS)
if(ISGAMETYPE(CTS))
rr = CTS_RECORD;
else
rr = RACE_RECORD;
......
......@@ -18,7 +18,7 @@ void HUD_Physics()
{
if(!autocvar_hud_panel_physics) return;
if(spectatee_status == -1 && (autocvar_hud_panel_physics == 1 || autocvar_hud_panel_physics == 3)) return;
if(autocvar_hud_panel_physics == 3 && !(gametype == MAPINFO_TYPE_RACE || gametype == MAPINFO_TYPE_CTS)) return;
if(autocvar_hud_panel_physics == 3 && !(ISGAMETYPE(RACE) || ISGAMETYPE(CTS))) return;
}
HUD_Panel_LoadCvars();
......
......@@ -98,7 +98,7 @@ void HUD_RaceTimer ()
if(!autocvar__hud_configure)
{
if(!autocvar_hud_panel_racetimer) return;
if(!(gametype == MAPINFO_TYPE_RACE || gametype == MAPINFO_TYPE_CTS)) return;
if(!(ISGAMETYPE(RACE) || ISGAMETYPE(CTS))) return;
if(spectatee_status == -1) return;
}
......
......@@ -343,7 +343,7 @@ void HUD_Radar()
IL_EACH(g_radaricons, it.teamradar_icon, {
if ( hud_panel_radar_mouse )
if ( GetResourceAmount(it, RESOURCE_HEALTH) >= 0 )
if ( it.team == myteam + 1 || gametype == MAPINFO_TYPE_RACE || !teamplay )
if ( it.team == myteam + 1 || ISGAMETYPE(RACE) || !teamplay )
{
vector coord = teamradar_texcoord_to_2dcoord(teamradar_3dcoord_to_texcoord(it.origin));
if(vdist((mousepos - coord), <, 8))
......
......@@ -140,7 +140,7 @@ void HUD_Score()
if(!autocvar__hud_configure)
{
if(!autocvar_hud_panel_score) return;
if(spectatee_status == -1 && (gametype == MAPINFO_TYPE_RACE || gametype == MAPINFO_TYPE_CTS)) return;
if(spectatee_status == -1 && (ISGAMETYPE(RACE) || ISGAMETYPE(CTS))) return;
}
HUD_Panel_LoadCvars();
......
......@@ -1145,7 +1145,7 @@ bool Scoreboard_WouldDraw()
return true;
else if (intermission == 2)
return false;
else if (spectatee_status != -1 && STAT(HEALTH) <= 0 && autocvar_cl_deathscoreboard && gametype != MAPINFO_TYPE_CTS && !active_minigame)
else if (spectatee_status != -1 && STAT(HEALTH) <= 0 && autocvar_cl_deathscoreboard && !ISGAMETYPE(CTS) && !active_minigame)
return true;
else if (scoreboard_showscores_force)
return true;
......@@ -1404,7 +1404,7 @@ vector Scoreboard_Rankings_Draw(vector pos, entity pl, vector rgb, vector bg_siz
vector hl_rgb = rgb + '0.5 0.5 0.5';
pos.y += hud_fontsize.y;
drawstring(pos + eX * panel_bg_padding, ((gametype == MAPINFO_TYPE_CTF) ? _("Capture time rankings") : _("Rankings")), hud_fontsize, '1 1 1', panel_fg_alpha, DRAWFLAG_NORMAL);
drawstring(pos + eX * panel_bg_padding, ((ISGAMETYPE(CTF)) ? _("Capture time rankings") : _("Rankings")), hud_fontsize, '1 1 1', panel_fg_alpha, DRAWFLAG_NORMAL);
pos.y += 1.25 * hud_fontsize.y;
if(panel.current_panel_bg != "0")
pos.y += panel_bg_border;
......@@ -1498,7 +1498,7 @@ float scoreboard_time;
bool have_weapon_stats;
bool Scoreboard_AccuracyStats_WouldDraw(float ypos)
{
if (gametype == MAPINFO_TYPE_CTS || gametype == MAPINFO_TYPE_RACE || gametype == MAPINFO_TYPE_NEXBALL)
if (ISGAMETYPE(CTS) || ISGAMETYPE(RACE) || ISGAMETYPE(NEXBALL))
return false;
if (!autocvar_hud_panel_scoreboard_accuracy || warmup_stage || ypos > 0.91 * vid_conheight)
return false;
......@@ -1666,7 +1666,7 @@ void Scoreboard_Draw()
if (Scoreboard_AccuracyStats_WouldDraw(pos.y))
pos = Scoreboard_AccuracyStats_Draw(pos, panel_bg_color, bg_size);
if(gametype == MAPINFO_TYPE_CTS || gametype == MAPINFO_TYPE_RACE || (autocvar_hud_panel_scoreboard_ctf_leaderboard && gametype == MAPINFO_TYPE_CTF && STAT(CTF_SHOWLEADERBOARD))) {
if(ISGAMETYPE(CTS) || ISGAMETYPE(RACE) || (autocvar_hud_panel_scoreboard_ctf_leaderboard && ISGAMETYPE(CTF) && STAT(CTF_SHOWLEADERBOARD))) {
if(race_speedaward) {
drawcolorcodedstring(pos, sprintf(_("Speed award: %d%s ^7(%s^7)"), race_speedaward, race_speedaward_unit, ColorTranslateRGB(race_speedaward_holder)), hud_fontsize, panel_fg_alpha, DRAWFLAG_NORMAL);
pos.y += 1.25 * hud_fontsize.y;
......@@ -1707,7 +1707,7 @@ void Scoreboard_Draw()
tl = STAT(TIMELIMIT);
fl = STAT(FRAGLIMIT);
ll = STAT(LEADLIMIT);
if(gametype == MAPINFO_TYPE_LMS)
if(ISGAMETYPE(LMS))
{
if(tl > 0)
str = strcat(str, sprintf(_(" for up to ^1%1.0f minutes^7"), tl));
......
......@@ -9,7 +9,7 @@
void HUD_Vote()
{
if(autocvar_cl_allow_uid2name == -1 && (gametype == MAPINFO_TYPE_CTS || gametype == MAPINFO_TYPE_RACE || (serverflags & SERVERFLAG_PLAYERSTATS)))
if(autocvar_cl_allow_uid2name == -1 && (ISGAMETYPE(CTS) || ISGAMETYPE(RACE) || (serverflags & SERVERFLAG_PLAYERSTATS)))
{
// this dialog gets overriden by the uid2name menu dialog, if it exists
// TODO remove this client side uid2name dialog in the next release
......
......@@ -140,6 +140,9 @@ void CSQC_Init()
registercvar("cl_spawn_near_teammate", "1");
registercvar("cl_weapon_switch_reload", "1");
registercvar("cl_weapon_switch_fallback_to_impulse", "1");
if(autocvar_cl_lockview)
cvar_set("cl_lockview", "0");
......
......@@ -11,6 +11,8 @@ string minimapname;
bool postinit;
entity gametype;
// temporary hack
#define ISGAMETYPE(NAME) (gametype == MAPINFO_TYPE_##NAME)
float FONT_USER = 8;
......
......@@ -128,7 +128,7 @@ void Draw_ShowNames(entity this)
// FIXME: alpha is negative when dead, breaking death fade
if (!this.csqcmodel_isdead) a *= f;
}
if (a < ALPHA_MIN_VISIBLE && gametype != MAPINFO_TYPE_CTS) return;
if (a < ALPHA_MIN_VISIBLE && ISGAMETYPE(CTS)) return;
if (vdist(this.origin - view_origin, >=, max_shot_distance)) return;
float dist = vlen(this.origin - view_origin);
if (autocvar_hud_shownames_maxdistance)
......
......@@ -1539,7 +1539,7 @@ void HUD_Draw(entity this)
if(autocvar_r_letterbox == 0)
if(autocvar_viewsize < 120)
{
if(!(gametype == MAPINFO_TYPE_RACE || gametype == MAPINFO_TYPE_CTS))
if(!(ISGAMETYPE(RACE) || ISGAMETYPE(CTS)))
Accuracy_LoadLevels();
HUD_Main();
......@@ -2467,7 +2467,7 @@ void CSQC_UpdateView(entity this, float w, float h)
else if(cvar("r_glsl_postprocess") == 2)
cvar_set("r_glsl_postprocess", "0");
/*if(gametype == MAPINFO_TYPE_CTF)
/*if(ISGAMETYPE(CTF))
{
ctf_view();
} else */
......
......@@ -41,5 +41,8 @@ void(entity bot) havocbot_ast_reset_role;
void(entity this, float ratingscale, vector org, float sradius) havocbot_goalrating_items;
void(entity this, float ratingscale, vector org, float sradius) havocbot_goalrating_enemyplayers;
// assault game mode: Which team is attacking in this round?
float assault_attacker_team;
// predefined spawnfuncs
void target_objective_decrease_activate(entity this);
......@@ -5,6 +5,7 @@
float autocvar_g_cts_finish_kill_delay;
bool autocvar_g_cts_selfdamage;
bool autocvar_g_cts_removeprojectiles;
// legacy bot roles
.float race_checkpoint;
......@@ -253,6 +254,14 @@ MUTATOR_HOOKFUNCTION(cts, PlayerDies)
frag_target.respawn_flags |= RESPAWN_FORCE;
race_AbandonRaceCheck(frag_target);
if(autocvar_g_cts_removeprojectiles)
{
IL_EACH(g_projectiles, it.owner == frag_target && (it.flags & FL_PROJECTILE),
{
delete(it);
});
}
}
MUTATOR_HOOKFUNCTION(cts, HavocBot_ChooseRole)
......
#include "sv_duel.qh"
MUTATOR_HOOKFUNCTION(duel, ReadLevelCvars)
{
if(autocvar_g_duel_warmup)
warmup_stage = 1; // otherwise allow it if it's enabled
//sv_ready_restart_after_countdown = 0;
}
MUTATOR_HOOKFUNCTION(duel, GetPlayerLimit)
{
M_ARGV(0, int) = 2; // duel is always 1v1!
......
......@@ -8,4 +8,3 @@ REGISTER_MUTATOR(duel, false)
}
bool autocvar_g_duel_with_powerups;
bool autocvar_g_duel_warmup = true;
......@@ -7,7 +7,7 @@ REGISTER_MUTATOR(cl_nb, true);
MUTATOR_HOOKFUNCTION(cl_nb, WantEventchase)
{
if(autocvar_cl_eventchase_nexball && gametype == MAPINFO_TYPE_NEXBALL && !(WepSet_GetFromStat() & WEPSET(NEXBALL)))
if(autocvar_cl_eventchase_nexball && ISGAMETYPE(NEXBALL) && !(WepSet_GetFromStat() & WEPSET(NEXBALL)))
return true;
return false;
}
......
......@@ -27,7 +27,6 @@ float autocvar_g_onslaught_teleport_radius;
float autocvar_g_onslaught_spawn_choose;
float autocvar_g_onslaught_click_radius;
void FixSize(entity e);
entity cam;
// =======================
......@@ -114,12 +113,6 @@ void ons_CaptureShield_Spawn(entity generator, bool is_generator)
// Junk Pile
// ==========
void setmodel_fixsize(entity e, Model m)
{
setmodel(e, m);
FixSize(e);
}
void onslaught_updatelinks()
{
entity l;
......@@ -438,7 +431,7 @@ void ons_ControlPoint_Icon_Damage(entity this, entity inflictor, entity attacker
this.owner.waslinked = this.owner.islinked;
if(this.owner.model != "models/onslaught/controlpoint_pad.md3")
setmodel_fixsize(this.owner, MDL_ONS_CP_PAD1);
setmodel(this.owner, MDL_ONS_CP_PAD1);
//setsize(this, '-32 -32 0', '32 32 8');
delete(this);
......@@ -578,7 +571,7 @@ void ons_ControlPoint_Icon_BuildThink(entity this)
this.SendFlags |= CPSF_SETUP;
}
if(this.owner.model != MDL_ONS_CP_PAD2.model_str())
setmodel_fixsize(this.owner, MDL_ONS_CP_PAD2);
setmodel(this.owner, MDL_ONS_CP_PAD2);
if(random() < 0.9 - GetResourceAmount(this, RESOURCE_HEALTH) / this.max_health)
Send_Effect(EFFECT_RAGE, this.origin + 10 * randomvec(), '0 0 -1', 1);
......@@ -737,7 +730,7 @@ void ons_ControlPoint_Reset(entity this)
setthink(this, ons_ControlPoint_Think);
this.ons_toucher = NULL;
this.nextthink = time + ONS_CP_THINKRATE;
setmodel_fixsize(this, MDL_ONS_CP_PAD1);
setmodel(this, MDL_ONS_CP_PAD1);
WaypointSprite_UpdateMaxHealth(this.sprite, 0);
WaypointSprite_UpdateRule(this.sprite,this.team,SPRITERULE_TEAMPLAY);
......@@ -781,7 +774,7 @@ void ons_ControlPoint_Setup(entity cp)
if(cp.message == "") { cp.message = "a"; }
// appearence
setmodel_fixsize(cp, MDL_ONS_CP_PAD1);
setmodel(cp, MDL_ONS_CP_PAD1);
// control point placement
if((cp.spawnflags & 1) || cp.noalign) // don't drop to floor, just stay at fixed location
......
......@@ -424,27 +424,7 @@ void _MapInfo_Map_Reset()
string _MapInfo_GetDefault(Gametype t)
{
switch(t)
{
case MAPINFO_TYPE_DEATHMATCH: return "30 20 0";
case MAPINFO_TYPE_TEAM_DEATHMATCH: return "50 20 2 0";
case MAPINFO_TYPE_DOMINATION: return "200 20 0";
case MAPINFO_TYPE_CTF: return "300 20 10 0";
case MAPINFO_TYPE_LMS: return "9 20 0";
case MAPINFO_TYPE_CA: return "10 20 0";
case MAPINFO_TYPE_KEYHUNT: return "1000 20 3 0";
case MAPINFO_TYPE_ASSAULT: return "20 0";
case MAPINFO_TYPE_RACE: return "20 5 7 15 0";
case MAPINFO_TYPE_ONSLAUGHT: return "20 0";
case MAPINFO_TYPE_NEXBALL: return "5 20 0";
case MAPINFO_TYPE_CTS: return "20 0 0";
case MAPINFO_TYPE_FREEZETAG: return "10 20 0";
// NOTE: DO NOT ADD ANY MORE GAME TYPES HERE
// THIS IS JUST LEGACY SUPPORT FOR NEXUIZ MAPS
// ONLY ADD NEW STUFF TO _MapInfo_GetDefaultEx
// THIS FUNCTION WILL EVENTUALLY BE REMOVED
default: return "";
}
return t.m_legacydefaults;
}
void _MapInfo_Map_ApplyGametype(string s, Gametype pWantedType, Gametype pThisType, int load_default)
......@@ -457,7 +437,7 @@ void _MapInfo_Map_ApplyGametype(string s, Gametype pWantedType, Gametype pThisTy
if(load_default)
_MapInfo_Map_ApplyGametype(_MapInfo_GetDefault(pThisType), pWantedType, pThisType, false);
if(pWantedType == MAPINFO_TYPE_ASSAULT || pWantedType == MAPINFO_TYPE_ONSLAUGHT || pWantedType == MAPINFO_TYPE_RACE || pWantedType == MAPINFO_TYPE_CTS) // these modes don't use fraglimit
if(!pWantedType.frags) // these modes don't use fraglimit
{
cvar_set("fraglimit", "0");
}
......@@ -485,6 +465,8 @@ void _MapInfo_Map_ApplyGametype(string s, Gametype pWantedType, Gametype pThisTy
// rc = timelimit timelimit_qualification laps laps_teamplay
if(pWantedType == MAPINFO_TYPE_RACE)
{
cvar_set("fraglimit", "0"); // special case!
sa = car(s); if(sa == "") sa = cvar_string("timelimit");
cvar_set("g_race_qualifying_timelimit", sa);
s = cdr(s);
......@@ -502,7 +484,7 @@ void _MapInfo_Map_ApplyGametype(string s, Gametype pWantedType, Gametype pThisTy
s = cdr(s);
}
if(pWantedType == MAPINFO_TYPE_ASSAULT || pWantedType == MAPINFO_TYPE_ONSLAUGHT || pWantedType == MAPINFO_TYPE_CTS) // these modes don't use fraglimit
if(!pWantedType.frags) // these modes don't use fraglimit
{
cvar_set("leadlimit", "0");
}
......@@ -742,22 +724,19 @@ void _MapInfo_Parse_Settemp(string pFilename, string acl, float type, string s,
float MapInfo_isRedundant(string fn, string t)
{
// normalize file name
fn = strreplace("_", "-", fn);
fn = strreplace("_", "", fn);
fn = strreplace("-", "", fn);
// normalize visible title
t = strreplace(": ", "-", t);
t = strreplace(":", "-", t);
t = strreplace(" ", "-", t);
t = strreplace("_", "-", t);
t = strreplace("'", "-", t);
if(!strcasecmp(fn, t))
return true;
t = strreplace(":", "", t);
t = strreplace(" ", "", t);
t = strreplace("_", "", t);
t = strreplace("-", "", t);
t = strreplace("'", "", t);
t = strdecolorize(t);
// we allow the visible title to have punctuation the file name does
// not, but not vice versa
t = strreplace("-", "", t);
if(!strcasecmp(fn, t))
return true;
......
This diff is collapsed.
......@@ -106,8 +106,6 @@ void conveyor_init(entity this)
this.reset = generic_netlinked_reset;
this.reset(this);
FixSize(this);
Net_LinkEntity(this, 0, false, conveyor_send);
this.SendFlags |= SF_TRIGGER_INIT;
......
......@@ -595,8 +595,6 @@ float door_send(entity this, entity to, float sf)
void door_link()
{
// set size now, as everything is loaded
//FixSize(this);
//Net_LinkEntity(this, false, 0, door_send);
}
#endif
......@@ -715,9 +713,6 @@ spawnfunc(func_door)
setblocked(this, door_blocked);
this.use = door_use;
this.pos1 = this.origin;
this.pos2 = this.pos1 + this.movedir*(fabs(this.movedir*this.size) - this.lip);
if(this.spawnflags & DOOR_NONSOLID)
this.solid = SOLID_NOT;
......@@ -728,6 +723,9 @@ spawnfunc(func_door)
door_init_shared(this);
this.pos1 = this.origin;
this.pos2 = this.pos1 + this.movedir*(fabs(this.movedir*this.size) - this.lip);
if (!this.speed)
{
this.speed = 100;
......
......@@ -41,6 +41,11 @@ void g_clientmodel_setcolormaptoactivator(entity this, entity actor, entity trig
void g_clientmodel_use(entity this, entity actor, entity trigger)
{
// Flag to set func_clientwall state
// 1 == deactivate, 2 == activate, 0 == do nothing
if(this.classname == "func_clientwall" || this.classname == "func_clientillusionary")
this.antiwall_flag = trigger.antiwall_flag;
if (this.antiwall_flag == 1)
{
this.inactive = 1;
......
......@@ -24,6 +24,7 @@ SUB_SetFade
Fade 'ent' out when time >= 'when'
==================
*/
.float fade_rate;
void SUB_SetFade(entity ent, float when, float fading_time);
.vector finaldest, finalangle; //plat.qc stuff
......
......@@ -10,17 +10,6 @@ void DelayThink(entity this)
delete(this);
}
void FixSize(entity e)
{
e.mins_x = rint(e.mins_x);
e.mins_y = rint(e.mins_y);
e.mins_z = rint(e.mins_z);
e.maxs_x = rint(e.maxs_x);
e.maxs_y = rint(e.maxs_y);
e.maxs_z = rint(e.maxs_z);
}
#ifdef SVQC
void generic_setactive(entity this, int act)
{
......@@ -313,12 +302,9 @@ void SUB_UseTargets_Ex(entity this, entity actor, entity trigger, bool preventRe
}
if (s != "")
{
// Flag to set func_clientwall state
// 1 == deactivate, 2 == activate, 0 == do nothing
int aw_flag = this.antiwall_flag;
for(entity t = NULL; (t = find(t, targetname, s)); )
{
if(t.use && (t.sub_target_used != time || !preventReuse))
if(t != this && t.use && (t.sub_target_used != time || !preventReuse))
{
if(this.target_random)
{
......@@ -326,9 +312,6 @@ void SUB_UseTargets_Ex(entity this, entity actor, entity trigger, bool preventRe
}
else
{
if (t.classname == "func_clientwall" || t.classname == "func_clientillusionary")
t.antiwall_flag = aw_flag;
t.use(t, actor, this);
if(preventReuse)
t.sub_target_used = time;
......
......@@ -40,8 +40,6 @@ void generic_netlinked_legacy_use(entity this, entity actor, entity trigger);
.vector dest;
void FixSize(entity e);
#ifdef CSQC
void trigger_common_read(entity this, bool withtarget);
void trigger_remove_generic(entity this);
......
......@@ -1103,7 +1103,8 @@ void spawn_held_nade(entity player, entity nowner, float ntime, int ntype, strin
n.alpha = Nades_from(STAT(NADE_BONUS_TYPE, n)).m_alpha;
setmodel(fn, MDL_NADE_VIEW);
setattachment(fn, player.(weaponentity), "");
//setattachment(fn, player.(weaponentity), "");
fn.viewmodelforclient = player;
fn.realowner = fn.owner = player;
fn.colormod = Nades_from(STAT(NADE_BONUS_TYPE, n)).m_color;
fn.colormap = player.colormap;
......
......@@ -51,8 +51,7 @@ void W_OverkillHeavyMachineGun_Attack_Auto(Weapon thiswep, entity actor, .entity
SpawnCasing (((random () * 50 + 50) * v_right) - (v_forward * (random () * 25 + 25)) - ((random () * 5 - 70) * v_up), 2, vectoangles(v_forward),'0 250 0', 100, 3, actor, weaponentity);
}
int slot = weaponslot(weaponentity);
ATTACK_FINISHED(actor, slot) = time + WEP_CVAR_PRI(okhmg, refire) * W_WeaponRateFactor(actor);
ATTACK_FINISHED(actor, weaponentity) = time + WEP_CVAR_PRI(okhmg, refire) * W_WeaponRateFactor(actor);
weapon_thinkf(actor, weaponentity, WFRAME_FIRE1, WEP_CVAR_PRI(okhmg, refire), W_OverkillHeavyMachineGun_Attack_Auto);
}
......
......@@ -45,8 +45,7 @@ void W_OverkillMachineGun_Attack_Auto(Weapon thiswep, entity actor, .entity weap
SpawnCasing(((random() * 50 + 50) * v_right) - (v_forward * (random() * 25 + 25)) - ((random() * 5 - 70) * v_up), 2, vectoangles(v_forward),'0 250 0', 100, 3, actor, weaponentity);
}
int slot = weaponslot(weaponentity);
ATTACK_FINISHED(actor, slot) = time + WEP_CVAR_PRI(okmachinegun, refire) * W_WeaponRateFactor(actor);
ATTACK_FINISHED(actor, weaponentity) = time + WEP_CVAR_PRI(okmachinegun, refire) * W_WeaponRateFactor(actor);
weapon_thinkf(actor, weaponentity, WFRAME_FIRE1, WEP_CVAR_PRI(okmachinegun, refire), W_OverkillMachineGun_Attack_Auto);
}
......
......@@ -102,7 +102,7 @@ MUTATOR_HOOKFUNCTION(ok, PlayerDies)
entity frag_attacker = M_ARGV(1, entity);
entity frag_target = M_ARGV(2, entity);
entity targ = ((frag_attacker) ? frag_attacker : frag_target);
entity targ = ((IS_PLAYER(frag_attacker)) ? frag_attacker : frag_target);
ok_DropItem(frag_target, targ);
......
......@@ -36,11 +36,15 @@ void _Movetype_WallFriction(entity this, vector stepnormal) // SV_WallFriction
vector planes[MAX_CLIP_PLANES];
int _Movetype_FlyMove(entity this, float dt, bool applygravity, vector stepnormal, float stepheight) // SV_FlyMove
{
if(dt <= 0)
return 0;
int blocked = 0;
int i, j, numplanes = 0;
float time_left = dt, grav = 0;
vector push;
vector primal_velocity, original_velocity, restore_velocity;
vector primal_velocity, original_velocity;
vector restore_velocity = this.velocity;
for(i = 0; i < MAX_CLIP_PLANES; ++i)
planes[i] = '0 0 0';
......@@ -59,7 +63,7 @@ int _Movetype_FlyMove(entity this, float dt, bool applygravity, vector stepnorma
}
}
original_velocity = primal_velocity = restore_velocity = this.velocity;
original_velocity = primal_velocity = this.velocity;
for(int bumpcount = 0;bumpcount < MAX_CLIP_PLANES;bumpcount++)
{
......@@ -67,8 +71,7 @@ int _Movetype_FlyMove(entity this, float dt, bool applygravity, vector stepnorma
break;
push = this.velocity * time_left;
_Movetype_PushEntity(this, push, true);
if(trace_startsolid)
if(!_Movetype_PushEntity(this, push, true, false))
{
// we got teleported by a touch function
// let's abort the move
......@@ -113,22 +116,19 @@ int _Movetype_FlyMove(entity this, float dt, bool applygravity, vector stepnorma
vector org = this.origin;
vector steppush = '0 0 1' * stepheight;
_Movetype_PushEntity(this, steppush, true);
if(trace_startsolid)
if(!_Movetype_PushEntity(this, steppush, true, false))
{
blocked |= 8;
break;
}
_Movetype_PushEntity(this, push, true);
if(trace_startsolid)
if(!_Movetype_PushEntity(this, push, true, false))
{
blocked |= 8;
break;
}
float trace2_fraction = trace_fraction;
steppush = '0 0 1' * (org.z - this.origin_z);
_Movetype_PushEntity(this, steppush, true);
if(trace_startsolid)