seta hud_panel_weapons_ammo_color "" "color of status bar"
seta hud_panel_weapons_ammo_alpha "" "alpha of status bar"
seta hud_panel_weapons_timeout "" "panel disappears if you don't switch weapon for this amount of seconds"
-seta hud_panel_weapons_timeout_effect "" "disappearance effect: 0) no effect; 1) panel moves out of screen; 2) panel fades out"
+seta hud_panel_weapons_timeout_effect "" "disappearance effect: 0) no effect; 1) panel fades out; 2) panel moves off the screen; 3) combination of 1 and 2"
+seta hud_panel_weapons_timeout_fadebgmin "" "minimum alpha of the panel background while in effect mode 1"
+seta hud_panel_weapons_timeout_fadefgmin "" "minimum alpha of the panel foreground while in effect mode 1"
+seta hud_panel_weapons_timeout_speed_in "" "speed that fading/moving onto the screen occurs"
+seta hud_panel_weapons_timeout_speed_out "" "speed that fading/moving off of the screen occurs"
seta hud_panel_weapons_label "" "1 = show number of weapon, 2 = show bound key of weapon"
seta hud_panel_weapons_accuracy "" "show accuracy color as the weapon icon background; colors can be configured with accuracy_color* cvars"
seta hud_panel_weapons_ammo "" "show ammo as a status bar"
// =================================
set sv_vote_call 1 "Allow users to call a vote for the commands in sv_vote_commands"
set sv_vote_change 1 "Allow voters to change their mind after already voting"
-set sv_vote_commands "restart fraglimit chmap gotomap nextmap endmatch reducematchtime extendmatchtime allready kick cointoss movetoauto" "these commands can be voted"
+set sv_vote_commands "restart fraglimit chmap gotomap nextmap endmatch reducematchtime extendmatchtime allready kick cointoss movetoauto shuffleteams" "these commands can be voted"
set sv_vote_only_commands ""
set sv_vote_master_commands "movetored movetoblue movetoyellow movetopink" "Extra commands which vote masters can execute by themselves, along with the normal sv_vote_commands." // maybe add kickban here (but then sv_vote_master 0)
set sv_vote_master 1 "Allows the use of the vote master system"
set sv_vote_stop 15 "a player can not call a vote again for this many seconds when he stopped this vote (e.g. to correct it)"
set sv_vote_majority_factor 0.5 "What percentage of the PLAYERS constitute a majority? (Must be at least 0.5, recommended: 0.5)"
set sv_vote_majority_factor_of_voted 0.5 "What percentage of the VOTERS constitute a majority too? (Must be at least 0.5, recommended: 0.5)"
+set sv_vote_gamestart 0 "Allow voting during map change"
// when disabled, don't allow game type changes "note: set these two equal to JUST support simple majorities"
set sv_vote_override_mostrecent 0
seta g_balance_teams 1 "automatically balance out players entering instead of asking them for their preferred team"
seta g_balance_teams_prevent_imbalance 1 "prevent players from changing to larger teams"
-set g_balance_teams_scorefactor 0.34 "at the end of the game, take score into account instead of team size by this amount (beware: values over 0.5 mean that a x:0 score imbalance will cause ALL new players to prefer the losing team at the end, despite numbers)"
+set g_balance_teams_scorefactor 0.25 "at the end of the game, take score into account instead of team size by this amount (beware: values over 0.5 mean that a x:0 score imbalance will cause ALL new players to prefer the losing team at the end, despite numbers)"
set g_changeteam_banned 0 "not allowed to change team"
set g_changeteam_fragtransfer 0 "% of frags you get to keep when you change teams (rounded down)"
seta hud_panel_weapons_ammo_color "0 1 0"
seta hud_panel_weapons_ammo_alpha "1"
seta hud_panel_weapons_aspect "2"
-seta hud_panel_weapons_timeout "5"
-seta hud_panel_weapons_timeout_effect "3"
+seta hud_panel_weapons_timeout "1"
+seta hud_panel_weapons_timeout_effect "1"
+seta hud_panel_weapons_timeout_fadebgmin "0.4"
+seta hud_panel_weapons_timeout_fadefgmin "0.4"
+seta hud_panel_weapons_timeout_speed_in "0.25"
+seta hud_panel_weapons_timeout_speed_out "0.75"
seta hud_panel_weapons_onlyowned "1"
seta hud_panel_ammo 1
seta hud_panel_weapons_aspect "2"
seta hud_panel_weapons_timeout "0"
seta hud_panel_weapons_timeout_effect "0"
+seta hud_panel_weapons_timeout_fadebgmin "0"
+seta hud_panel_weapons_timeout_fadefgmin "0"
+seta hud_panel_weapons_timeout_speed_in "0.25"
+seta hud_panel_weapons_timeout_speed_out "0.75"
seta hud_panel_weapons_onlyowned "1"
seta hud_panel_ammo 1
seta hud_panel_weapons_aspect "2"
seta hud_panel_weapons_timeout "0"
seta hud_panel_weapons_timeout_effect "0"
+seta hud_panel_weapons_timeout_fadebgmin "0"
+seta hud_panel_weapons_timeout_fadefgmin "0"
+seta hud_panel_weapons_timeout_speed_in "0.25"
+seta hud_panel_weapons_timeout_speed_out "0.75"
seta hud_panel_weapons_onlyowned "1"
seta hud_panel_ammo 1
seta hud_panel_weapons_aspect "2"
seta hud_panel_weapons_timeout "3"
seta hud_panel_weapons_timeout_effect "1"
+seta hud_panel_weapons_timeout_fadebgmin "0"
+seta hud_panel_weapons_timeout_fadefgmin "0"
+seta hud_panel_weapons_timeout_speed_in "0.25"
+seta hud_panel_weapons_timeout_speed_out "0.75"
seta hud_panel_weapons_onlyowned "1"
seta hud_panel_ammo 1
seta hud_panel_weapons_aspect "2"
seta hud_panel_weapons_timeout "0"
seta hud_panel_weapons_timeout_effect "0"
+seta hud_panel_weapons_timeout_fadebgmin "0"
+seta hud_panel_weapons_timeout_fadefgmin "0"
+seta hud_panel_weapons_timeout_speed_in "0.25"
+seta hud_panel_weapons_timeout_speed_out "0.75"
seta hud_panel_weapons_onlyowned "0"
seta hud_panel_ammo 1
QCCFLAGS_WATERMARK ?= -DWATERMARK='"$(shell git describe)"' -DCVAR_POPCON=1
QCC ?= fteqcc
-VERSION_MESSAGE = $(shell $(QCC) --version --help)
+VERSION_MESSAGE = $(shell cd server && $(QCC) --version --help)
ifneq (,$(findstring GMQCC,$(VERSION_MESSAGE)))
# this is gmqcc
-QCCFLAGS_WATERMARK =
-QCCFLAGS ?= -Wall -Wno-field-redeclared -Wno-double-declaration -Wno-assign-function-types -Wno-unused-variable -std=fteqcc -fshort-logic -O1 -flno $(QCCFLAGS_EXTRA) $(QCCFLAGS_WATERMARK)
+QCCFLAGS ?= \
+ -std=fteqcc \
+ -Werror -Wall \
+ -Wno-field-redeclared \
+ -Wno-double-declaration \
+ -Wno-uninitialized-global \
+ -O3 \
+ -fadjust-vector-fields \
+ -fftepp \
+ -fftepp-predefs \
+ -frelaxed-switch \
+ -fshort-logic \
+ -fno-perl-logic \
+ -ftranslatable-strings \
+ -fno-initialized-nonconstants \
+ -fno-assign-function-types \
+ -flno \
+ -fcorrect-ternary \
+ -fno-single-vector-defs \
+ -fcorrect-logic \
+ -ftrue-empty-strings \
+ -fno-false-empty-strings \
+ -futf8 \
+ -fno-bail-on-werror \
+ -floop-labels \
+ -funtyped-nil \
+ -fno-permissive \
+ $(QCCFLAGS_EXTRA) $(QCCFLAGS_WATERMARK)
else
# this. is. fteqccccccccccccccccccc!
QCCFLAGS ?= -Werror -Wno-Q302 -O3 -Ono-return_only -fno-fastarrays $(QCCFLAGS_EXTRA) $(QCCFLAGS_WATERMARK)
check_unacceptable_compiler_bugs();
#ifdef WATERMARK
- print(sprintf(_("^4CSQC Build information: ^1%s\n"), WATERMARK()));
+ print(sprintf(_("^4CSQC Build information: ^1%s\n"), WATERMARK));
#endif
float i;
draw_endBoldFont();
menu_visible = FALSE;
menu_show = menu_show_error;
- menu_action = menu_sub_null;
+ menu_action = func_null;
for(i = 0; i < 255; ++i)
if(getplayerkeyvalue(i, "viewentity") == "")
turrets_precache();
Announcer_Precache();
Tuba_Precache();
+ CSQCPlayer_Precache();
if(autocvar_cl_reticle)
{
if (MapVote_InputEvent(bInputType, nPrimary, nSecondary))
return true;
- if(menu_visible)
+ if(menu_visible && menu_action)
if(menu_action(bInputType, nPrimary, nSecondary))
return TRUE;
self.origin_x = ReadShort();
self.origin_y = ReadShort();
self.origin_z = ReadShort();
+ setorigin(self, self.origin);
}
if(sf & 4)
{
self.skeletonindex = 0;
}
+ if(self.snd_looping > 0)
+ {
+ sound(self, self.snd_looping, "misc/null.wav", VOL_BASE, autocvar_g_jetpack_attenuation);
+ self.snd_looping = 0;
+ }
+
self.enttype = 0;
self.classname = "";
self.draw = menu_sub_null;
string getcommandkey(string text, string command)
{
string keys;
- float n, j, k, l;
+ float n, j, k, l = 0;
if (!autocvar_hud_showbinds)
return text;
keys = db_get(binddb, command);
- if (!keys)
+ if (keys == "")
{
n = tokenize(findkeysforcommand(command, 0)); // uses '...' strings
for(j = 0; j < n; ++j)
}
}
+ if (keys == "")
+ keys = "NO_KEY";
db_put(binddb, command, keys);
}
- if ("" == keys) {
+ if (keys == "NO_KEY") {
if (autocvar_hud_showbinds > 1)
return sprintf(_("%s (not bound)"), text);
else
if(!CheckWireframeBox(porto, p - 48 * v_right - 48 * v_up + 16 * v_forward, 96 * v_right, 96 * v_up, 96 * v_forward))
return;
if(portal_number == 1)
+ {
portal1_idx = idx;
- if(portal_number >= 2)
- break;
+ if(portal_number >= 2)
+ break;
+ }
}
while(idx >= 2)
vid_width = vf_size_x;
vid_height = vf_size_y;
- vector reticle_pos, reticle_size;
- vector splash_pos, splash_size;
+ vector reticle_pos = '0 0 0', reticle_size = '0 0 0';
+ vector splash_pos = '0 0 0', splash_size = '0 0 0';
WaypointSprite_Load();
// improved polyblend
- vector rgb;
if(autocvar_hud_contents)
{
float contentalpha_temp, incontent, liquidalpha, contentfadetime;
}
// edge detection postprocess handling done second (used by hud_powerup)
- float sharpen_intensity, strength_finished = getstatf(STAT_STRENGTH_FINISHED), invincible_finished = getstatf(STAT_INVINCIBLE_FINISHED);
+ float sharpen_intensity = 0, strength_finished = getstatf(STAT_STRENGTH_FINISHED), invincible_finished = getstatf(STAT_INVINCIBLE_FINISHED);
if (strength_finished - time > 0) { sharpen_intensity += (strength_finished - time); }
if (invincible_finished - time > 0) { sharpen_intensity += (invincible_finished - time); }
else
shottype = SHOTTYPE_HITWORLD;
- vector wcross_color, wcross_size;
- string wcross_wep, wcross_name;
+ vector wcross_color = '0 0 0', wcross_size = '0 0 0';
+ string wcross_wep = "", wcross_name;
float wcross_scale, wcross_blur;
if (autocvar_crosshair_per_weapon || autocvar_crosshair_color_per_weapon) {
if (autocvar_crosshair_ring || autocvar_crosshair_ring_reload)
{
// declarations and stats
- float ring_value, ring_scale, ring_alpha, ring_inner_value, ring_inner_alpha;
- string ring_image, ring_inner_image;
- vector ring_rgb, ring_inner_rgb;
+ float ring_value = 0, ring_scale = 0, ring_alpha = 0, ring_inner_value = 0, ring_inner_alpha = 0;
+ string ring_image = string_null, ring_inner_image = string_null;
+ vector ring_rgb = '0 0 0', ring_inner_rgb = '0 0 0';
ring_scale = autocvar_crosshair_ring_size;
{
float timelimit = getstatf(STAT_TIMELIMIT);
float timeleft = max(0, timelimit * 60 + getstatf(STAT_GAMESTARTTIME) - time);
- float warmup_timeleft;
+ float warmup_timeleft = 0;
if(warmup_stage)
if(autocvar_g_warmup_limit > 0)
float autocvar_hud_panel_weapons_complainbubble_fadetime;
float autocvar_hud_panel_weapons_complainbubble_padding;
float autocvar_hud_panel_weapons_complainbubble_time;
-var float autocvar_hud_panel_weapons_fade = 1;
float autocvar_hud_panel_weapons_label;
float autocvar_hud_panel_weapons_onlyowned;
float autocvar_hud_panel_weapons_timeout;
float autocvar_hud_panel_weapons_timeout_effect;
+float autocvar_hud_panel_weapons_timeout_fadebgmin;
+float autocvar_hud_panel_weapons_timeout_fadefgmin;
+var float autocvar_hud_panel_weapons_timeout_speed_in = 0.25;
+var float autocvar_hud_panel_weapons_timeout_speed_out = 0.75;
float autocvar_hud_progressbar_alpha;
float autocvar_hud_showbinds;
float autocvar_hud_showbinds_limit;
float autocvar_cl_deathglow;
float autocvar_developer_csqcentities;
float autocvar__animblend;
+float autocvar_g_jetpack_attenuation;
casing.origin_x = ReadCoord();
casing.origin_y = ReadCoord();
casing.origin_z = ReadCoord();
+ setorigin(casing, casing.origin);
casing.velocity = decompressShortVector(ReadShort());
casing.angles_x = ReadByte() * 360 / 256;
casing.angles_y = ReadByte() * 360 / 256;
if(self.csqcmodel_teleported)
Projectile_ResetTrail(self.origin);
}
+.float snd_looping;
void CSQCModel_Effects_Apply(void)
{
float eff = self.csqcmodel_effects;
if(self.csqcmodel_effects & CSQCMODEL_EF_RESPAWNGHOST)
self.renderflags |= RF_ADDITIVE;
// also special in CSQCPlayer_GlowMod_Apply
+
+ if(self.csqcmodel_modelflags & MF_ROCKET)
+ {
+ if(!self.snd_looping)
+ {
+ sound(self, CH_TRIGGER_SINGLE, "misc/jetpack_fly.wav", VOL_BASE, autocvar_g_jetpack_attenuation);
+ self.snd_looping = CH_TRIGGER_SINGLE;
+ }
+ }
+ else
+ {
+ if(self.snd_looping)
+ {
+ sound(self, self.snd_looping, "misc/null.wav", VOL_BASE, autocvar_g_jetpack_attenuation);
+ self.snd_looping = 0;
+ }
+ }
+}
+
+void CSQCPlayer_Precache()
+{
+ precache_sound("misc/jetpack_fly.wav");
}
// FEATURE: auto glowmod
{
// particle effects for players and objects damaged by weapons (eg: flames coming out of victims shot with rockets)
- float life, nearestbone;
+ float life, nearestbone = 0;
string specstr, effectname;
entity e;
continue; // player model bone blacklist
// now choose the bone closest to impact origin
- if(vlen(hitorg - gettaginfo(self, tagnum)) <= vlen(hitorg - gettaginfo(self, nearestbone)))
+ if(nearestbone == 0 || vlen(hitorg - gettaginfo(self, tagnum)) <= vlen(hitorg - gettaginfo(self, nearestbone)))
nearestbone = tagnum;
}
gettaginfo(self, nearestbone); // set gettaginfo_name
void Ent_DamageInfo(float isNew)
{
- float dmg, rad, edge, thisdmg, forcemul, species, hitplayer;
+ float dmg, rad, edge, thisdmg, forcemul, species, hitplayer = FALSE;
vector force, thisforce;
entity oldself;
{
float seglength, drifts, drifte, branchfactor, branchfactor_add;
- seglength = autocvar_cl_effects_lightningarc_segmentlength;
- drifts = autocvar_cl_effects_lightningarc_drift_start;
- drifte = autocvar_cl_effects_lightningarc_drift_end;
- branchfactor = autocvar_cl_effects_lightningarc_branchfactor_start;
- branchfactor = autocvar_cl_effects_lightningarc_branchfactor_add;
+ seglength = autocvar_cl_effects_lightningarc_segmentlength;
+ drifts = autocvar_cl_effects_lightningarc_drift_start;
+ drifte = autocvar_cl_effects_lightningarc_drift_end;
+ branchfactor = autocvar_cl_effects_lightningarc_branchfactor_start;
+ branchfactor_add = autocvar_cl_effects_lightningarc_branchfactor_add;
cl_effetcs_lightningarc(from,to,seglength,drifts,drifte,branchfactor,branchfactor_add);
}
org = trace_endpos;
}
- gib.move_origin = gib.origin = org;
+ gib.move_origin = org;
+ setorigin(gib, org);
gib.move_velocity = vconst * autocvar_cl_gibs_velocity_scale + vrand * autocvar_cl_gibs_velocity_random + '0 0 1' * autocvar_cl_gibs_velocity_up;
gib.move_avelocity = prandomvec() * vlen(gib.move_velocity) * autocvar_cl_gibs_avelocity_scale;
gib.move_time = time;
vector org, vel;
string specstr;
float issilent;
- string gentle_prefix;
+ string gentle_prefix = "morphed_";
float c, randomvalue;
gentle_prefix = "";
else if(cl_gentle_gibs == 3)
gentle_prefix = "happy_";
- else
- gentle_prefix = "morphed_";
}
else if(autocvar_cl_particlegibs)
{
if(amount <= 0 || !isNew)
return;
- self.origin = org; // for the sounds
+ setorigin(self, org); // for the sounds
specnum = (type & 0x78) / 8; // blood/gibmodel type: using four bits (0..7, bit indexes 3,4,5)
issilent = (type & 0x40);
col = "^3";
}
else
+ {
col = "^7";
+ timestr = "";
+ }
if(cp == 254)
cpname = _("Start line");
WEPSET_COPY_AS(weapons_stat);
float i, f, a, j, factor;
float screen_ar, center_x, center_y;
- float weapon_count, weapon_id, weapon_alpha;
+ float weapon_count, weapon_id;
float row, column, rows, columns;
float aspect = autocvar_hud_panel_weapons_aspect;
- float show_accuracy, panel_weapon_accuracy;
+ float show_accuracy = false, panel_weapon_accuracy;
float timeout = autocvar_hud_panel_weapons_timeout;
- float timein_effect_length = (autocvar_hud_panel_weapons_timeout_effect ? 0.375 : 0);
- float timeout_effect_length = (autocvar_hud_panel_weapons_timeout_effect ? 0.75 : 0);
+ float timein_effect_length = autocvar_hud_panel_weapons_timeout_speed_in; //? 0.375 : 0);
+ float timeout_effect_length = autocvar_hud_panel_weapons_timeout_speed_out; //? 0.75 : 0);
- float ammo_type, ammo_full, ammo_alpha;
- float barsize_x, barsize_y, baroffset_x, baroffset_y;
+ float ammo_type, ammo_full;
+ float barsize_x = 0, barsize_y = 0, baroffset_x = 0, baroffset_y = 0;
+ vector ammo_color = '1 0 1';
+ float ammo_alpha = 1;
float when = autocvar_hud_panel_weapons_complainbubble_time;
float fadetime = autocvar_hud_panel_weapons_complainbubble_fadetime;
vector weapon_pos, weapon_size;
local noref vector old_panel_size; // fteqcc sucks
- vector color, ammo_color;
+ vector color;
// check to see if we want to continue
if(hud != HUD_NORMAL) { return; }
{
if((!autocvar_hud_panel_weapons) || (spectatee_status == -1))
return;
- else if(timeout && time >= weapontime + timeout + timeout_effect_length)
+ else if(timeout && time >= weapontime + timeout + timeout_effect_length && ((autocvar_hud_panel_weapons_timeout_effect != 1) && !(autocvar_hud_panel_weapons_timeout_fadebgmin + autocvar_hud_panel_weapons_timeout_fadefgmin)))
{
weaponprevtime = time;
return;
draw_beginBoldFont();
- // calculate fading effect to weapon images for when the panel is idle
- if(autocvar_hud_panel_weapons_fade)
- {
- weapon_alpha = 3.2 - 2 * (time - weapontime);
- weapon_alpha = bound(0.7, weapon_alpha, 1) * panel_fg_alpha;
- }
- else
- weapon_alpha = panel_fg_alpha;
-
// figure out weapon order (how the weapons are sorted) // TODO make this configurable
if(weaponorder_bypriority != autocvar_cl_weaponpriority || !weaponorder[0])
{
}
// do we own this weapon?
+ weapon_count = 0;
for(i = 0; i <= WEP_LAST-WEP_FIRST; ++i)
if(WEPSET_CONTAINS_AW(weapons_stat, weaponorder[i].weapon))
++weapon_count;
{
if (timeout && time >= weapontime + timeout) // apply timeout effect if needed
{
- f = (time - (weapontime + timeout)) / timeout_effect_length;
- if (autocvar_hud_panel_weapons_timeout_effect == 1 || autocvar_hud_panel_weapons_timeout_effect == 3)
+ f = bound(0, (time - (weapontime + timeout)) / timeout_effect_length, 1);
+
+ // fade the panel alpha
+ if(autocvar_hud_panel_weapons_timeout_effect == 1)
+ {
+ panel_bg_alpha *= (autocvar_hud_panel_weapons_timeout_fadebgmin * f + (1 - f));
+ panel_fg_alpha *= (autocvar_hud_panel_weapons_timeout_fadefgmin * f + (1 - f));
+ }
+ else if(autocvar_hud_panel_weapons_timeout_effect == 3)
{
panel_bg_alpha *= (1 - f);
panel_fg_alpha *= (1 - f);
}
+
+ // move the panel off the screen
if (autocvar_hud_panel_weapons_timeout_effect == 2 || autocvar_hud_panel_weapons_timeout_effect == 3)
{
f *= f; // for a cooler movement
}
else if (timeout && time < weaponprevtime + timein_effect_length) // apply timein effect if needed
{
- f = (time - weaponprevtime) / timein_effect_length;
- if (autocvar_hud_panel_weapons_timeout_effect == 1 || autocvar_hud_panel_weapons_timeout_effect == 3)
+ f = bound(0, (time - weaponprevtime) / timein_effect_length, 1);
+
+ // fade the panel alpha
+ if(autocvar_hud_panel_weapons_timeout_effect == 1)
+ {
+ panel_bg_alpha *= (autocvar_hud_panel_weapons_timeout_fadebgmin * (1 - f) + f);
+ panel_fg_alpha *= (autocvar_hud_panel_weapons_timeout_fadefgmin * (1 - f) + f);
+ }
+ else if(autocvar_hud_panel_weapons_timeout_effect == 3)
{
panel_bg_alpha *= (f);
panel_fg_alpha *= (f);
}
+
+ // move the panel back on screen
if (autocvar_hud_panel_weapons_timeout_effect == 2 || autocvar_hud_panel_weapons_timeout_effect == 3)
{
f *= f; // for a cooler movement
acc_col[i] = stov(cvar_string(strcat("accuracy_color", ftos(i))));
}
+ row = column = 0;
for(i = 0; i <= WEP_LAST-WEP_FIRST; ++i)
{
// retrieve information about the current weapon to be drawn
// draw background behind currently selected weapon
if(self.weapon == switchweapon)
- drawpic_aspect_skin(weapon_pos, "weapon_current_bg", weapon_size, '1 1 1', weapon_alpha, DRAWFLAG_NORMAL);
+ drawpic_aspect_skin(weapon_pos, "weapon_current_bg", weapon_size, '1 1 1', panel_fg_alpha, DRAWFLAG_NORMAL);
// draw the weapon accuracy
if(show_accuracy)
if(WEPSET_CONTAINS_AW(weapons_stat, self.weapon))
{
// draw the weapon image
- drawpic_aspect_skin(weapon_pos, strcat("weapon", self.netname), weapon_size, '1 1 1', weapon_alpha, DRAWFLAG_NORMAL);
+ drawpic_aspect_skin(weapon_pos, strcat("weapon", self.netname), weapon_size, '1 1 1', panel_fg_alpha, DRAWFLAG_NORMAL);
// draw weapon label string
switch(autocvar_hud_panel_weapons_label)
mySize -= '2 2 0' * panel_bg_padding;
}
- float rows, columns, row, column;
+ float rows = 0, columns, row, column;
vector ammo_size;
if (autocvar_hud_panel_ammo_onlycurrent)
ammo_size = mySize;
ammo_size = eX * mySize_x*(1/columns) + eY * mySize_y*(1/rows);
}
- local noref vector offset; // fteqcc sucks
+ local vector offset = '0 0 0'; // fteqcc sucks
float newSize;
if(ammo_size_x/ammo_size_y > 3)
{
stat_items = getstati(STAT_ITEMS, 0, 24);
if (stat_items & IT_UNLIMITED_WEAPON_AMMO)
infinite_ammo = TRUE;
+ row = column = 0;
for (i = 0; i < AMMO_COUNT; ++i) {
currently_selected = stat_items & GetAmmoItemCode(i);
DrawAmmoItem(pos + eX * column * (ammo_size_x + offset_x) + eY * row * (ammo_size_y + offset_y), ammo_size, i, currently_selected, infinite_ammo);
void DrawNumIcon_expanding(vector myPos, vector mySize, float x, string icon, float vertical, float icon_right_align, vector color, float theAlpha, float fadelerp)
{
- vector newPos, newSize;
+ vector newPos = '0 0 0', newSize = '0 0 0';
vector picpos, numpos;
if (vertical)
float panel_ar = mySize_x/mySize_y;
float is_vertical = (panel_ar < 1);
- vector shield_offset, strength_offset, superweapons_offset;
+ vector shield_offset = '0 0 0', strength_offset = '0 0 0', superweapons_offset = '0 0 0';
float superweapons_is = -1;
superweapons_iconalign = strength_iconalign;
superweapons_baralign = strength_baralign;
}
- else if(superweapons_is == 2)
+ else // if(superweapons_is == 2)
{
superweapons_offset = shield_offset;
superweapons_iconalign = shield_iconalign;
{
float panel_ar = mySize_x/mySize_y;
float is_vertical = (panel_ar < 1);
- vector health_offset, armor_offset;
+ vector health_offset = '0 0 0', armor_offset = '0 0 0';
if (panel_ar >= 4 || (panel_ar >= 1/4 && panel_ar < 1))
{
mySize_x *= 0.5;
void HUD_Score_Rankings(vector pos, vector mySize, entity me, float team_count)
{
float score;
- entity tm, pl;
+ entity tm = world, pl;
#define SCOREPANEL_MAX_ENTRIES 6
#define SCOREPANEL_ASPECTRATIO 2
float entries = bound(1, floor(SCOREPANEL_MAX_ENTRIES * mySize_y/mySize_x * SCOREPANEL_ASPECTRATIO), SCOREPANEL_MAX_ENTRIES);
float name_size = mySize_x*0.75;
float spacing_size = mySize_x*0.04;
const float highlight_alpha = 0.2;
- float i, me_printed, first_pl;
+ float i = 0, me_printed = 0, first_pl = 0;
string s;
- i = 0;
- first_pl = 0;
if (autocvar__hud_configure)
{
- float players_per_team;
+ float players_per_team = 0;
if (team_count)
{
// show team scores in the first line
{
rgb = '1 1 0';
drawfill(pos, eX * mySize_x + eY * fontsize_y, rgb, highlight_alpha * panel_fg_alpha, DRAWFLAG_NORMAL);
- s = GetPlayerName(pl.sv_entnum);
+ s = GetPlayerName(player_localnum);
score = 7;
}
else
mySize -= '2 2 0' * panel_bg_padding;
}
- float score, distribution;
+ float score, distribution = 0;
string sign;
vector distribution_color;
entity tm, pl, me;
drawstring_aspect(pos + eX * 0.75 * mySize_x, distribution_str, eX * 0.25 * mySize_x + eY * (1/3) * mySize_y, distribution_color, panel_fg_alpha, DRAWFLAG_NORMAL);
draw_endBoldFont();
} else { // teamgames
- float scores_count, row, column, rows, columns;
- local noref vector offset; // fteqcc sucks
+ float scores_count = 0, row, column, rows = 0, columns = 0;
+ local noref vector offset = '0 0 0';
vector score_pos, score_size; //for scores other than myteam
if (spectatee_status == -1 || autocvar_hud_panel_score_rankings)
{
float max_fragcount;
max_fragcount = -99;
draw_beginBoldFont();
+ row = column = 0;
for(tm = teams.sort_next; tm; tm = tm.sort_next) {
if(tm.team == COLOR_SPECTATOR)
continue;
}
// always force 4:1 aspect
- vector newSize;
+ vector newSize = '0 0 0';
if(mySize_x/mySize_y > 4)
{
newSize_x = 4 * mySize_y;
if(race_mycheckpointtime)
{
a = bound(0, 2 - (time - race_mycheckpointtime), 1);
- s = MakeRaceString(race_mycheckpoint, TIME_DECODE(race_mycheckpointdelta), -!race_mycheckpointenemy, race_mycheckpointlapsdelta, race_mycheckpointenemy);
+ s = MakeRaceString(race_mycheckpoint, TIME_DECODE(race_mycheckpointdelta), -(race_mycheckpointenemy == ""), race_mycheckpointlapsdelta, race_mycheckpointenemy);
drawcolorcodedstring(pos + eX * 0.5 * mySize_x - '0.5 0 0' * stringwidth(s, TRUE, '1 1 0' * 0.2 * mySize_y) + eY * 0.6 * mySize_y, s, '1 1 0' * 0.2 * mySize_y, panel_fg_alpha * a, DRAWFLAG_NORMAL);
}
if(race_othercheckpointtime && race_othercheckpointenemy != "")
{
a = bound(0, 2 - (time - race_othercheckpointtime), 1);
- s = MakeRaceString(race_othercheckpoint, -TIME_DECODE(race_othercheckpointdelta), -!race_othercheckpointenemy, race_othercheckpointlapsdelta, race_othercheckpointenemy);
+ s = MakeRaceString(race_othercheckpoint, -TIME_DECODE(race_othercheckpointdelta), -(race_othercheckpointenemy == ""), race_othercheckpointlapsdelta, race_othercheckpointenemy);
drawcolorcodedstring(pos + eX * 0.5 * mySize_x - '0.5 0 0' * stringwidth(s, TRUE, '1 1 0' * 0.2 * mySize_y) + eY * 0.6 * mySize_y, s, '1 1 0' * 0.2 * mySize_y, panel_fg_alpha * a, DRAWFLAG_NORMAL);
}
}
// always force 3:1 aspect
- vector newSize;
+ vector newSize = '0 0 0';
if(mySize_x/mySize_y > 3)
{
newSize_x = 3 * mySize_y;
float kh_keys;
float keyteam;
float a, aa;
- vector p, pa, kh_size, kh_asize;
+ vector p = '0 0 0', pa, kh_size = '0 0 0', kh_asize = '0 0 0';
kh_keys = getstati(STAT_KH_KEYS);
float rank;
if(race_status > 0)
rank = race_CheckName(race_status_name);
+ else
+ rank = 0;
string rankname;
rankname = race_PlaceName(rank);
float stat, pps_ratio;
string pic;
vector color;
+#ifdef GMQCC
+ stat = -1;
+ pic = "";
+ color = '0 0 0';
+#endif
switch(i)
{
case 0:
pic = "dom_icon_yellow";
color = '1 1 0';
break;
+ default:
case 3:
stat = getstatf(STAT_DOM_PPS_PINK);
pic = "dom_icon_pink";
color = '1 0 1';
+ break;
}
pps_ratio = stat / getstatf(STAT_DOM_TOTAL_PPS);
{
mod_active = 1; // required in each mod function that always shows something
entity tm;
- float teams_count;
+ float teams_count = 0;
for(tm = teams.sort_next; tm; tm = tm.sort_next)
if(tm.team != COLOR_SPECTATOR)
++teams_count;
columns = ceil(teams_count/rows);
int i;
- float row, column;
+ float row = 0, column = 0;
for(i=0; i<teams_count; ++i)
{
vector pos, itemSize;
float aspect = autocvar_hud_panel_pressedkeys_aspect;
if(aspect)
{
- vector newSize;
+ vector newSize = '0 0 0';
if(mySize_x/mySize_y > aspect)
{
newSize_x = aspect * mySize_y;
}
// always force 5:1 aspect
- vector newSize;
+ vector newSize = '0 0 0';
if(mySize_x/mySize_y > 5)
{
newSize_x = 5 * mySize_y;
if(teamplay && !intermission && !spectatee_status && gametype != MAPINFO_TYPE_CA && teamnagger)
{
- float ts_min, ts_max;
+ float ts_min = 0, ts_max = 0;
tm = teams.sort_next;
if (tm)
{
panel_size -= '2 2 0' * panel_bg_padding;
}
- float acceleration_progressbar_scale;
+ float acceleration_progressbar_scale = 0;
if(autocvar_hud_panel_physics_progressbar && autocvar_hud_panel_physics_acceleration_progressbar_scale > 1)
acceleration_progressbar_scale = autocvar_hud_panel_physics_acceleration_progressbar_scale;
//compute layout
float panel_ar = panel_size_x/panel_size_y;
- vector speed_offset, acceleration_offset;
+ vector speed_offset = '0 0 0', acceleration_offset = '0 0 0';
if (panel_ar >= 5 && !acceleration_progressbar_scale)
{
panel_size_x *= 0.5;
HUD_Panel_GetProgressBarColor(speed);
HUD_Panel_DrawProgressBar(panel_pos + speed_offset, panel_size, "progressbar", speed/max_speed, 0, speed_baralign, progressbar_color, autocvar_hud_progressbar_alpha * panel_fg_alpha, DRAWFLAG_NORMAL);
}
- vector tmp_offset, tmp_size;
+ vector tmp_offset = '0 0 0', tmp_size = '0 0 0';
if (autocvar_hud_panel_physics_text == 1 || autocvar_hud_panel_physics_text == 2)
{
tmp_size_x = panel_size_x * 0.75;
if(autocvar_hud_panel_physics_progressbar == 1 || autocvar_hud_panel_physics_progressbar == 2)
{
float peak_offset_x;
- vector peak_size;
+ vector peak_size = '0 0 0';
if (speed_baralign == 0)
peak_offset_x = min(top_speed, max_speed)/max_speed * panel_size_x;
else if (speed_baralign == 1)
peak_offset_x = (1 - min(top_speed, max_speed)/max_speed) * panel_size_x;
- else if (speed_baralign == 2)
+ else // if (speed_baralign == 2)
peak_offset_x = min(top_speed, max_speed)/max_speed * panel_size_x * 0.5;
//if speed is not 0 the speed progressbar already fetched the color
if (speed == 0)
entries = bound(1, floor(panel_size_y/height), CENTERPRINT_MAX_ENTRIES);
float i, j, k, n;
- float a, sz, align, current_msg_pos_y, msg_size;
+ float a, sz, align, current_msg_pos_y = 0, msg_size;
vector pos;
string ts;
a = bound(0, (time - (centerprint_expire_time[j] - centerprint_time[j])) / max(0.0001, autocvar_hud_panel_centerprint_fade_in), 1);
else if (centerprint_expire_time[j] > time)
a = (centerprint_expire_time[j] - time) / max(0.0001, autocvar_hud_panel_centerprint_fade_out);
+ else
+ a = 0;
// set the size from fading in/out before subsequent fading
sz = autocvar_hud_panel_centerprint_fade_minfontsize + a * (1 - autocvar_hud_panel_centerprint_fade_minfontsize);
if(autocvar__hud_panelorder != hud_panelorder_prev) {
for(i = 0; i < HUD_PANEL_NUM; ++i)
panel_order[i] = -1;
- string s;
- float p_num, warning;
+ string s = "";
+ float p_num, warning = false;
float argc = tokenize_console(autocvar__hud_panelorder);
if (argc > HUD_PANEL_NUM)
warning = true;
HUD_Write_PanelCvar_q("_aspect");
HUD_Write_PanelCvar_q("_timeout");
HUD_Write_PanelCvar_q("_timeout_effect");
+ HUD_Write_PanelCvar_q("_timeout_fadebgmin");
+ HUD_Write_PanelCvar_q("_timeout_fadefgmin");
+ HUD_Write_PanelCvar_q("_timeout_speed_in");
+ HUD_Write_PanelCvar_q("_timeout_speed_out");
HUD_Write_PanelCvar_q("_onlyowned");
break;
case HUD_PANEL_AMMO:
con_keys = findkeysforcommand("toggleconsole", 0);
keys = tokenize(con_keys); // findkeysforcommand returns data for this
- float hit_con_bind, i;
+ float hit_con_bind = 0, i;
for (i = 0; i < keys; ++i)
{
if(nPrimary == stof(argv(i)))
}
tab_backward = (hudShiftState & S_SHIFT);
- float k, level, start_pos_x;
- vector candidate_pos;
+ float k, level = 0, start_pos_x;
+ vector candidate_pos = '0 0 0';
const float LEVELS_NUM = 4;
float level_height = vid_conheight / LEVELS_NUM;
:find_tab_panel
float HUD_Panel_Check_Mouse_Pos(float allow_move)
{
- float i, j, border;
+ float i, j = 0, border;
while(j < HUD_PANEL_NUM)
{
panel_order[0] = id;
// let's save them into the cvar by some strcat trickery
- string s;
+ string s = "";
for(i = 0; i < HUD_PANEL_NUM; ++i)
{
s = strcat(s, ftos(panel_order[i]), " ");
void HUD_Panel_Highlight(float allow_move)
{
- float i, j, border;
+ float i, j = 0, border;
while(j < HUD_PANEL_NUM)
{
HUD_Panel_SetPos(mousepos - panel_click_distance);
else if(highlightedAction == 2)
{
- vector mySize;
+ vector mySize = '0 0 0';
if(resizeCorner == 1) {
mySize_x = panel_click_resizeorigin_x - (mousepos_x - panel_click_distance_x);
mySize_y = panel_click_resizeorigin_y - (mousepos_y - panel_click_distance_y);
self.origin_x = ReadCoord();
self.origin_y = ReadCoord();
self.origin_z = ReadCoord();
+ setorigin(self, self.origin);
}
if(f & 8)
{
-const string string_null;
-
// --------------------------------------------------------------------------
// MENU Functionality
post = _(" (1 vote)");
else if(count >= 0)
post = sprintf(_(" (%d votes)"), count);
+ else
+ post = "";
}
else
post = "";
void MapVote_DrawMapItem(vector pos, float isize, float tsize, string map, string pic, float count, float id)
{
- vector img_size;
+ vector img_size = '0 0 0';
vector rgb;
string label;
float text_size;
float center;
float columns, rows;
float tsize;
- vector dist;
+ vector dist = '0 0 0';
if(!mv_active)
return;
-var float(string text, float handleColors, vector fontSize) stringwidth;
-
entity players;
entity teams;
vector rotate(vector v, float a)
{
- vector w;
+ vector w = '0 0 0';
// FTEQCC SUCKS AGAIN
w_x = v_x * cos(a) + v_y * sin(a);
w_y = -1 * v_x * sin(a) + v_y * cos(a);
void drawborderlines(float thickness, vector pos, vector dim, vector color, float theAlpha, float drawflag)
{
- vector line_dim;
+ vector line_dim = '0 0 0';
// left and right lines
pos_x -= thickness;
void drawpic_tiled(vector pos, string pic, vector sz, vector area, vector color, float theAlpha, float drawflag)
{
- vector current_pos, end_pos, new_size, ratio;
+ vector current_pos = '0 0 0', end_pos, new_size = '0 0 0', ratio = '0 0 0';
end_pos = pos + area;
current_pos_y = pos_y;
void ModelEffect_Draw()
{
self.angles = self.angles + frametime * self.avelocity;
- self.origin = self.origin + frametime * self.velocity;
+ setorigin(self, self.origin + frametime * self.velocity);
self.scale = self.scale1 + (self.scale2 - self.scale1) * (time - self.teleport_time) / (self.lifetime + self.fadetime - self.teleport_time);
self.alpha = self.cnt * bound(0, 1 - (time - self.lifetime) / self.fadetime, 1);
if(self.alpha < ALPHA_MIN_VISIBLE)
e.origin_x = ReadCoord();
e.origin_y = ReadCoord();
e.origin_z = ReadCoord();
+ setorigin(e, e.origin);
if(f & 1)
{
e.velocity_x = ReadCoord();
}
if(self.noise != "")
{
- self.origin = p;
+ setorigin(self, p);
sound(self, CH_AMBIENT, self.noise, VOL_BASE * self.volume, self.atten);
}
self.just_toggled = 0;
--i;
}
}
- self.origin = o;
+ setorigin(self, o);
}
void Ent_PointParticles_Remove()
.float trail_oldtime;
.float fade_time, fade_rate;
-void SUB_Null()
-{
-}
-
void SUB_Stop()
{
self.move_velocity = self.move_avelocity = '0 0 0';
return;
sound(e, ch, samp, vol, attn);
- e.snd_looping = 1;
+ e.snd_looping = ch;
}
void Ent_RemoveProjectile()
{
- if(self.snd_looping)
- sound(self, CH_SHOTS_SINGLE, "misc/null.wav", VOL_BASE, ATTN_NORM);
-
if(self.count & 0x80)
{
tracebox(self.origin, self.mins, self.maxs, self.origin + self.velocity * 0.05, MOVE_NORMAL, self);
self.origin_x = ReadCoord();
self.origin_y = ReadCoord();
self.origin_z = ReadCoord();
+ setorigin(self, self.origin);
if(self.count & 0x80)
{
self.velocity_x = ReadCoord();
self.mins = '0 0 -4';
self.maxs = '0 0 -4';
self.move_movetype = MOVETYPE_BOUNCE;
- self.move_touch = SUB_Null;
+ self.move_touch = func_null;
self.move_bounce_factor = g_balance_electro_secondary_bouncefactor;
self.move_bounce_stopspeed = g_balance_electro_secondary_bouncestop;
break;
self.mins = '-3 -3 -3';
self.maxs = '3 3 3';
self.move_movetype = MOVETYPE_BOUNCE;
- self.move_touch = SUB_Null;
+ self.move_touch = func_null;
self.move_bounce_factor = g_balance_grenadelauncher_bouncefactor;
self.move_bounce_stopspeed = g_balance_grenadelauncher_bouncestop;
break;
self.colormod = '2 1 1';
self.alphamod = 0.5;
self.move_movetype = MOVETYPE_BOUNCE;
- self.move_touch = SUB_Null;
+ self.move_touch = func_null;
break;
case PROJECTILE_PORTO_BLUE:
self.colormod = '1 1 2';
self.alphamod = 0.5;
self.move_movetype = MOVETYPE_BOUNCE;
- self.move_touch = SUB_Null;
+ self.move_touch = func_null;
break;
case PROJECTILE_HAGAR_BOUNCING:
self.move_movetype = MOVETYPE_BOUNCE;
- self.move_touch = SUB_Null;
+ self.move_touch = func_null;
break;
case PROJECTILE_CRYLINK_BOUNCING:
self.move_movetype = MOVETYPE_BOUNCE;
- self.move_touch = SUB_Null;
+ self.move_touch = func_null;
break;
case PROJECTILE_FIREBALL:
loopsound(self, CH_SHOTS_SINGLE, "weapons/fireball_fly2.wav", VOL_BASE, ATTN_NORM);
case PROJECTILE_FIREMINE:
loopsound(self, CH_SHOTS_SINGLE, "weapons/fireball_fly.wav", VOL_BASE, ATTN_NORM);
self.move_movetype = MOVETYPE_BOUNCE;
- self.move_touch = SUB_Null;
+ self.move_touch = func_null;
self.mins = '-4 -4 -4';
self.maxs = '4 4 4';
break;
self.mins = '0 0 -4';
self.maxs = '0 0 -4';
self.move_movetype = MOVETYPE_BOUNCE;
- self.move_touch = SUB_Null;
+ self.move_touch = func_null;
self.move_bounce_factor = g_balance_electro_secondary_bouncefactor;
self.move_bounce_stopspeed = g_balance_electro_secondary_bouncestop;
break;
default:
break;
}
+ setsize(self, self.mins, self.maxs);
}
if(self.gravity)
*/
}
+float HUD_CompareScore(float vl, float vr, float f)
+{
+ if(f & SFL_ZERO_IS_WORST)
+ {
+ if(vl == 0 && vr != 0)
+ return 1;
+ if(vl != 0 && vr == 0)
+ return 0;
+ }
+ if(vl > vr)
+ return IS_INCREASING(f);
+ if(vl < vr)
+ return IS_DECREASING(f);
+ return -1;
+}
+
float HUD_ComparePlayerScores(entity left, entity right)
{
- float vl, vr;
+ float vl, vr, r, i;
vl = GetPlayerColor(left.sv_entnum);
vr = GetPlayerColor(right.sv_entnum);
return false;
}
- vl = left.scores[ps_primary];
- vr = right.scores[ps_primary];
- if(scores_flags[ps_primary] & SFL_ZERO_IS_WORST)
- {
- if(vl == 0 && vr != 0)
- return 1;
- if(vl != 0 && vr == 0)
- return 0;
- }
- if(vl > vr)
- return IS_INCREASING(scores_flags[ps_primary]);
- if(vl < vr)
- return IS_DECREASING(scores_flags[ps_primary]);
+ r = HUD_CompareScore(left.scores[ps_primary], right.scores[ps_primary], scores_flags[ps_primary]);
+ if (r >= 0)
+ return r;
+
+ r = HUD_CompareScore(left.scores[ps_secondary], right.scores[ps_secondary], scores_flags[ps_secondary]);
+ if (r >= 0)
+ return r;
- vl = left.scores[ps_secondary];
- vr = right.scores[ps_secondary];
- if(scores_flags[ps_secondary] & SFL_ZERO_IS_WORST)
+ for(i = 0; i < MAX_SCORE; ++i)
{
- if(vl == 0 && vr != 0)
- return 1;
- if(vl != 0 && vr == 0)
- return 0;
+ r = HUD_CompareScore(left.scores[i], right.scores[i], scores_flags[i]);
+ if (r >= 0)
+ return r;
}
- if(vl > vr)
- return IS_INCREASING(scores_flags[ps_secondary]);
- if(vl < vr)
- return IS_DECREASING(scores_flags[ps_secondary]);
+
+ if (left.sv_entnum < right.sv_entnum)
+ return true;
return false;
}
float HUD_CompareTeamScores(entity left, entity right)
{
- float vl, vr;
+ float i, r;
if(left.team == COLOR_SPECTATOR)
return 1;
if(right.team == COLOR_SPECTATOR)
return 0;
- vl = left.teamscores[ts_primary];
- vr = right.teamscores[ts_primary];
- if(vl > vr)
- return IS_INCREASING(teamscores_flags[ts_primary]);
- if(vl < vr)
- return IS_DECREASING(teamscores_flags[ts_primary]);
+ r = HUD_CompareScore(left.teamscores[ts_primary], right.teamscores[ts_primary], teamscores_flags[ts_primary]);
+ if (r >= 0)
+ return r;
- vl = left.teamscores[ts_secondary];
- vr = right.teamscores[ts_secondary];
- if(vl > vr)
- return IS_INCREASING(teamscores_flags[ts_secondary]);
- if(vl < vr)
- return IS_DECREASING(teamscores_flags[ts_secondary]);
+ r = HUD_CompareScore(left.teamscores[ts_secondary], right.teamscores[ts_secondary], teamscores_flags[ts_secondary]);
+ if (r >= 0)
+ return r;
+
+ for(i = 0; i < MAX_SCORE; ++i)
+ {
+ r = HUD_CompareScore(left.teamscores[i], right.teamscores[i], teamscores_flags[i]);
+ if (r >= 0)
+ return r;
+ }
+
+ if (left.team < right.team)
+ return true;
return false;
}
{
float i, j, slash;
string str, pattern;
- float have_name, have_primary, have_secondary, have_separator;
+ float have_name = 0, have_primary = 0, have_secondary = 0, have_separator = 0;
float missing;
// TODO: re enable with gametype dependant cvars?
vector HUD_Scoreboard_MakeTable(vector pos, entity tm, vector rgb, vector bg_size)
{
float body_table_height, i;
- vector tmp, column_dim;
+ vector tmp = '0 0 0', column_dim = '0 0 0';
entity pl;
body_table_height = 1.25 * hud_fontsize_y * max(1, tm.team_size); // no player? show 1 empty line
drawstring(pos, sprintf(_("Accuracy stats (average %d%%)"), average_accuracy), hud_fontsize, '1 1 1', scoreboard_alpha_fg, DRAWFLAG_NORMAL);
pos_y += 1.25 * hud_fontsize_y + autocvar_scoreboard_border_thickness;
- vector tmp;
+ vector tmp = '0 0 0';
tmp_x = sbwidth;
tmp_y = height * rows;
pos_y += 1.25 * hud_fontsize_y + autocvar_scoreboard_border_thickness;
// draw table
- vector tmp;
+ vector tmp = '0 0 0';
tmp_x = sbwidth;
tmp_y = hud_fontsize_y * rows;
pos_y += hud_fontsize_y;
drawstring(pos, _("Rankings"), hud_fontsize, '1 1 1', scoreboard_alpha_fg, DRAWFLAG_NORMAL);
pos_y += hud_fontsize_y + autocvar_scoreboard_border_thickness;
- vector tmp;
+ vector tmp = '0 0 0';
tmp_x = sbwidth;
tmp_y = 1.25 * hud_fontsize_y * RANKINGS_RECEIVED_CNT;
pos = HUD_Scoreboard_MakeTable(pos, tm, rgb, bg_size);
}
+
+#ifdef GMQCC
+ rgb = '0 0 0';
+#endif
+ rgb_x = autocvar_scoreboard_color_bg_r;
+ rgb_y = autocvar_scoreboard_color_bg_g;
+ rgb_z = autocvar_scoreboard_color_bg_b;
}
else
{
+#ifdef GMQCC
+ rgb = '0 0 0';
+#endif
rgb_x = autocvar_scoreboard_color_bg_r;
rgb_y = autocvar_scoreboard_color_bg_g;
rgb_z = autocvar_scoreboard_color_bg_b;
drawcolorcodedstring(pos, sprintf(_("All-time fastest: %d ^7(%s^7)"), race_speedaward_alltimebest, race_speedaward_alltimebest_holder), hud_fontsize, scoreboard_alpha_fg, DRAWFLAG_NORMAL);
pos_y += 1.25 * hud_fontsize_y;
}
- pos = HUD_DrawScoreboardRankings(pos, pl, rgb, bg_size);
+ pos = HUD_DrawScoreboardRankings(pos, playerslots[player_localnum], rgb, bg_size);
}
else if(autocvar_scoreboard_accuracy && spectatee_status != -1 && !warmup_stage) {
if(teamplay)
}
// handle tag fading
- float overlap, onscreen, crosshairdistance;
+ float overlap = FALSE, onscreen, crosshairdistance;
vector o, eo;
o = project_3d_to_2d(ent.origin);
e.sameteam = 0;
}
- e.origin = getplayerorigin(i);
+ setorigin(e, getplayerorigin(i));
if(e.origin == GETPLAYERORIGIN_ERROR)
continue;
self.origin_x = ReadCoord();
self.origin_y = ReadCoord();
self.origin_z = ReadCoord();
+ setorigin(self, self.origin);
}
if(sendflags & 2)
gib.gravity = 1;
gib.move_movetype = MOVETYPE_BOUNCE;
- gib.move_origin = gib.origin = _from;
+ gib.move_origin = _from;
+ setorigin(gib, _from);
gib.move_velocity = _to;
gib.move_avelocity = prandomvec() * 32;
gib.move_time = time;
self.origin_x = ReadCoord();
self.origin_y = ReadCoord();
self.origin_z = ReadCoord();
+ setorigin(self, self.origin);
self.angles_x = ReadAngle();
self.angles_y = ReadAngle();
#define MAX_AXH 4
entity AuxiliaryXhair[MAX_AXH];
-const var void Draw_Not();
.string axh_image;
.float axh_fadetime;
}
if(time - self.cnt > self.axh_fadetime)
- self.draw2d = Draw_Not;
+ self.draw2d = func_null;
}
void Net_AuXair2(float bIsNew)
if(axh == world || wasfreed(axh)) // MADNESS? THIS IS QQQQCCCCCCCCC (wasfreed, why do you exsist?)
{
axh = spawn();
- axh.draw2d = Draw_Not;
+ axh.draw2d = func_null;
axh.drawmask = MASK_NORMAL;
axh.axh_drawflag = DRAWFLAG_ADDITIVE;
axh.axh_fadetime = 0.1;
remove(axh);
axh = spawn();
- axh.draw2d = Draw_Not;
+ axh.draw2d = func_null;
axh.drawmask = MASK_NORMAL;
axh.axh_drawflag = DRAWFLAG_NORMAL;
axh.axh_fadetime = 0.1;
}
}
#define HUD_GETSTATS \
- float vh_health = getstati(STAT_VEHICLESTAT_HEALTH); \
- float shield = getstati(STAT_VEHICLESTAT_SHIELD); \
- float energy = getstati(STAT_VEHICLESTAT_ENERGY); \
- float ammo1 = getstati(STAT_VEHICLESTAT_AMMO1); \
- float reload1 = getstati(STAT_VEHICLESTAT_RELOAD1); \
- float ammo2 = getstati(STAT_VEHICLESTAT_AMMO2); \
- float reload2 = getstati(STAT_VEHICLESTAT_RELOAD2);
+ local noref float vh_health = getstati(STAT_VEHICLESTAT_HEALTH); \
+ local noref float shield = getstati(STAT_VEHICLESTAT_SHIELD); \
+ local noref float energy = getstati(STAT_VEHICLESTAT_ENERGY); \
+ local noref float ammo1 = getstati(STAT_VEHICLESTAT_AMMO1); \
+ local noref float reload1 = getstati(STAT_VEHICLESTAT_RELOAD1); \
+ local noref float ammo2 = getstati(STAT_VEHICLESTAT_AMMO2); \
+ local noref float reload2 = getstati(STAT_VEHICLESTAT_RELOAD2);
void CSQC_BUMBLE_HUD()
{
if(autocvar_r_letterbox)
return;
- vector picsize, hudloc, pic2size, picloc;
+ vector picsize, hudloc = '0 0 0', pic2size, picloc;
// Fetch health & ammo stats
HUD_GETSTATS
drawresetcliparea();
// Right gunner slot occupied?
- if(AuxiliaryXhair[1].draw2d == Draw_Not)
+ if(!AuxiliaryXhair[1].draw2d)
{
shield = (picsize_x * 0.5) - (0.5 * stringwidth(_("No right gunner!"), FALSE, '1 0 0' * picsize_y + '0 1 0' * picsize_y));
drawfill(hudloc + picloc - '0.2 0.2 0', picsize + '0.4 0.4 0', '0.25 0.25 0.25', 0.75, DRAWFLAG_NORMAL);
drawpic(hudloc + picloc, hud_ammo2_bar, picsize, '1 1 1', 1, DRAWFLAG_NORMAL);
drawresetcliparea();
// Left gunner slot occupied?
- if(AuxiliaryXhair[2].draw2d == Draw_Not)
+ if(!AuxiliaryXhair[2].draw2d)
{
shield = (picsize_x * 0.5) - (0.5 * stringwidth(_("No left gunner!"), FALSE, '1 0 0' * picsize_y + '0 1 0' * picsize_y));
drawfill(hudloc + picloc - '0.2 0.2 0', picsize + '0.4 0.4 0', '0.25 0.25 0.25', 0.75, DRAWFLAG_NORMAL);
if(autocvar_r_letterbox)
return;
- vector picsize, hudloc, pic2size, picloc;
+ vector picsize, hudloc = '0 0 0', pic2size, picloc;
// Fetch health & ammo stats
HUD_GETSTATS
if(autocvar_r_letterbox)
return;
- vector picsize, hudloc, pic2size, picloc;
+ vector picsize, hudloc = '0 0 0', pic2size, picloc;
float i;
// Fetch health & ammo stats
if(autocvar_r_letterbox)
return;
- vector picsize, hudloc, pic2size, picloc;
+ vector picsize, hudloc = '0 0 0', pic2size, picloc;
// Fetch health & ammo stats
HUD_GETSTATS
if(autocvar_r_letterbox)
return;
- vector picsize, hudloc, pic2size, picloc;
+ vector picsize, hudloc = '0 0 0', pic2size, picloc;
// Fetch health & ammo stats
HUD_GETSTATS
var .vector fld;
if(self.bgmscriptangular)
- self.angles = self.saved;
+ fld = angles;
else
- self.origin = self.saved;
+ fld = origin;
+ self.fld = self.saved;
if(self.lodmodelindex1)
{
InterpolateOrigin_Do();
- if(self.bgmscriptangular)
- self.saved = self.angles;
- else
- self.saved = self.origin;
+ self.saved = self.fld;
f = BGMScript(self);
if(f >= 0)
void Ent_Wall()
{
float f;
+ var .vector fld;
+
InterpolateOrigin_Undo();
self.iflags = IFLAG_ANGLES;
if(self.bgmscriptangular)
- self.angles = self.saved;
+ fld = angles;
else
- self.origin = self.saved;
+ fld = origin;
+ self.fld = self.saved;
f = ReadByte();
self.origin_x = ReadCoord();
self.origin_y = ReadCoord();
self.origin_z = ReadCoord();
+ setorigin(self, self.origin);
}
if(f & 4)
}
else
self.mins = self.maxs = '0 0 0';
+ setsize(self, self.mins, self.maxs);
if(self.bgmscript)
strunzone(self.bgmscript);
InterpolateOrigin_Note();
- if(self.bgmscriptangular)
- self.saved = self.angles;
- else
- self.saved = self.origin;
+ self.saved = self.fld;
self.entremove = Ent_Wall_Remove;
self.draw = Ent_Wall_Draw;
self.origin_x = ReadCoord();
self.origin_y = ReadCoord();
self.origin_z = ReadCoord();
+ setorigin(self, self.origin);
}
if(sendflags & 1)
cvar_set(do_cvar, data);
strunzone(do_cvar);
}
- if(!do_exec && !do_cvar)
- print(data);
+ if(!do_exec)
+ if not(do_cvar)
+ print(data);
}
return;
s = db_get(_MapInfo_Cache_DB_NameToIndex, MapInfo_Map_bspname);
- if(!s) // empty string is NOT valid here!
+ if(s == "")
{
i = buf_getsize(_MapInfo_Cache_Buf_IndexToMapData);
db_put(_MapInfo_Cache_DB_NameToIndex, MapInfo_Map_bspname, ftos(i));
return 0;
s = db_get(_MapInfo_Cache_DB_NameToIndex, map);
- if(!s)
+ if(s == "")
return 0;
i = stof(s);
string _MapInfo_GlobItem(float i)
{
string s;
+ if(!_MapInfo_globopen)
+ return string_null;
s = search_getfilename(_MapInfo_globhandle, i);
return substring(s, 5, strlen(s) - 9); // without maps/ and .bsp
}
void MapInfo_Enumerate()
{
if(_MapInfo_globopen)
+ {
search_end(_MapInfo_globhandle);
+ _MapInfo_globopen = 0;
+ }
MapInfo_Cache_Invalidate();
_MapInfo_globhandle = search_begin("maps/*.bsp", TRUE, TRUE);
- _MapInfo_globcount = search_getsize(_MapInfo_globhandle);
- _MapInfo_globopen = 1;
+ if(_MapInfo_globhandle >= 0)
+ {
+ _MapInfo_globcount = search_getsize(_MapInfo_globhandle);
+ _MapInfo_globopen = 1;
+ }
+ else
+ _MapInfo_globcount = 0;
}
// filter the info by game type mask (updates MapInfo_count)
void sv_notice_join()
{
// to-do: make sv_join_notices support per-entry times
- if(!autocvar_sv_join_notices || autocvar_sv_join_notices == "")
+ if(autocvar_sv_join_notices == "")
return;
entity n = spawn();
#define M1 30
#define M2 10
- vector v1, v2, v3;
+ vector v1, v2 = '0 0 0', v3;
v1 = '1 1 0' * M1;
v2_x = vid_conwidth - (2 * M1);
v2_y = vid_conheight - (2 * M1);
# define COMPAT_NO_MOD_IS_XONOTIC
# define COMPAT_XON060_DONTCRASH_CHECKPVS
#endif
+
+#ifdef FTEQCC
+#ifdef WATERMARK
+string FTEQCC_SUCKS_WATERMARKS_THROUGH_C60_FULLERENES = WATERMARK();
+#undef WATERMARK
+#define WATERMARK FTEQCC_SUCKS_WATERMARKS_THROUGH_C60_FULLERENES
+#endif
+#endif
if(strstrofs(strcat(",", pattern, ","), subpattern, 0) < 0)
if(strstrofs(strcat(",", pattern, ","), subpattern2, 0) < 0)
if(strstrofs(strcat(",", pattern, ","), subpattern3, 0) < 0)
- if((!subpattern4) || strstrofs(strcat(",", pattern, ","), subpattern4, 0) < 0)
- return 0;
+ {
+ if not(subpattern4)
+ return 0;
+ if(strstrofs(strcat(",", pattern, ","), subpattern4, 0) < 0)
+ return 0;
+ }
}
return 1;
}
#endif
// the NULL function
+#ifdef GMQCC
+#define func_null nil
+#define string_null nil
+#else
var void func_null(void);
var string string_null;
+#endif
float float2range11(float f);
float float2range01(float f);
void CSQCModel_Draw()
{
// some nice flags for CSQCMODEL_IF and the hooks
- float isplayer = (self.entnum >= 1 && self.entnum <= maxclients);
- float islocalplayer = (self.entnum == player_localnum + 1);
- float isnolocalplayer = (isplayer && (self.entnum != player_localnum + 1));
+ local noref float isplayer = (self.entnum >= 1 && self.entnum <= maxclients);
+ local noref float islocalplayer = (self.entnum == player_localnum + 1);
+ local noref float isnolocalplayer = (isplayer && (self.entnum != player_localnum + 1));
// we don't do this for the local player as that one is already handled
// by CSQCPlayer_SetCamera()
sf = ReadShort();
// some nice flags for CSQCMODEL_IF and the hooks
- float isplayer = (self.entnum >= 1 && self.entnum <= maxclients);
- float islocalplayer = (self.entnum == player_localnum + 1);
- float isnolocalplayer = (isplayer && (self.entnum != player_localnum + 1));
+ local noref float isplayer = (self.entnum >= 1 && self.entnum <= maxclients);
+ local noref float islocalplayer = (self.entnum == player_localnum + 1);
+ local noref float isnolocalplayer = (isplayer && (self.entnum != player_localnum + 1));
self.classname = "csqcmodel";
self.iflags |= IFLAG_ANGLES; // interpolate angles too
}
void InterpolateOrigin_Undo()
{
- self.origin = self.iorigin2;
+ setorigin(self, self.iorigin2);
if(self.iflags & IFLAG_ANGLES)
self.angles = fixedvectoangles2(self.iforward2, self.iup2);
if(self.iflags & IFLAG_VELOCITY)
#include "item/textslider.c"
#include "item/listbox.c"
#include "item/inputbox.c"
-#include "item/gecko.c"
#include "xonotic/dialog.c"
#include "xonotic/tab.c"
#include "xonotic/mainwindow.c"
#include "xonotic/image.c"
#include "xonotic/crosshairbutton.c"
#include "xonotic/playermodel.c"
-#include "xonotic/dialog_news.c"
#include "xonotic/checkbox_slider_invalid.c"
#include "xonotic/charmap.c"
#include "xonotic/keybinder.c"
return;
}
- if(argv(0) == "curl")
- {
- }
-
print(_("Invalid command. For a list of supported commands, try menu_cmd help.\n"));
}
METHOD(Button, mouseDrag, float(entity, vector))
METHOD(Button, mouseRelease, float(entity, vector))
METHOD(Button, focusEnter, void(entity))
- ATTRIB(Button, onClick, void(entity, entity), SUB_Null)
+ ATTRIB(Button, onClick, void(entity, entity), func_null)
ATTRIB(Button, onClickEntity, entity, NULL)
ATTRIB(Button, src, string, string_null)
ATTRIB(Button, srcSuffix, string, string_null)
{
if(cvar("menu_sounds"))
localsound("sound/misc/menu2.wav");
- me.onClick(me, me.onClickEntity);
+ if(me.onClick)
+ me.onClick(me, me.onClickEntity);
}
me.pressed = 0;
}
{
// keyboard click timer expired? Fire the event then.
if not(me.disabled)
- me.onClick(me, me.onClickEntity);
+ if(me.onClick)
+ me.onClick(me, me.onClickEntity);
}
me.clickTime -= frametime;
+++ /dev/null
-// Andreas Kirsch Gecko item (to test it)
-#ifdef INTERFACE
-CLASS(Gecko) EXTENDS(Item)
- METHOD(Gecko, configureBrowser, void( entity, string ) )
- METHOD(Gecko, draw, void(entity))
- METHOD(Gecko, keyDown, float(entity, float, float, float))
- METHOD(Gecko, keyUp, float(entity, float, float, float))
- METHOD(Gecko, mouseMove, float(entity, vector))
- METHOD(Gecko, mouseDrag, float(entity, vector))
- METHOD(Gecko, resizeNotify, void(entity, vector, vector, vector, vector))
- ATTRIB(Gecko, texturePath, string, string_null )
- ATTRIB(Gecko, textureExtent, vector, '0 0 0')
-ENDCLASS(Gecko)
-#endif
-
-#ifdef IMPLEMENTATION
-// define static members
-float _gecko_instanceNumber;
-
-void Gecko_configureBrowser( entity me, string URI ) {
- me.focusable = 1;
-
- //create a new gecko object if needed
- if( !me.texturePath ) {
- me.texturePath = strzone( strcat( "_dynamic/gecko/menu/", ftos( _gecko_instanceNumber ) ) );
- _gecko_instanceNumber+=1;
- // TODO: add error checks
- gecko_create( me.texturePath );
- }
- gecko_navigate( me.texturePath, URI );
-}
-
-void Gecko_draw(entity me)
-{
- vector drawSize;
-
- if( me.texturePath ) {
- /* The gecko browser is actually only drawn to a part of the
- texture. Correct scaling so that part fills up the whole
- item area. */
- drawSize_x = 1.0 / me.textureExtent_x;
- drawSize_y = 1.0 / me.textureExtent_y;
- draw_Picture( '0 0 0', strcat( "/", me.texturePath ),
- drawSize, '1 1 1', 1.0 );
- } else {
- vector fontsize;
- fontsize_x = fontsize_y = 1.0 / 30.0;
- fontsize_z = 0.0;
- draw_Text( '0 0 0', _("Browser not initialized!"), fontsize, '1 1 1', 1.0, 0 );
- }
- SUPER(Gecko).draw(me);
-}
-
-float Gecko_keyDown(entity me, float scan, float ascii, float shift)
-{
- if( scan == K_ESCAPE ) {
- return 0;
- }
- if (ascii >= 32)
- return gecko_keyevent( me.texturePath, ascii, GECKO_BUTTON_DOWN );
- else
- return gecko_keyevent( me.texturePath, scan, GECKO_BUTTON_DOWN );
-}
-
-float Gecko_keyUp(entity me, float scan, float ascii, float shift)
-{
- if (ascii >= 32)
- return gecko_keyevent( me.texturePath, ascii, GECKO_BUTTON_UP );
- else
- return gecko_keyevent( me.texturePath, scan, GECKO_BUTTON_UP );
-}
-
-float Gecko_mouseMove(entity me, vector pos)
-{
- gecko_mousemove( me.texturePath, pos_x, pos_y );
- return 1;
-}
-
-float Gecko_mouseDrag(entity me, vector pos)
-{
- gecko_mousemove( me.texturePath, pos_x, pos_y );
- return 1;
-}
-
-void Gecko_resizeNotify(entity me, vector relOrigin, vector relSize, vector absOrigin, vector absSize)
-{
- SUPER(Gecko).resizeNotify(me, relOrigin, relSize, absOrigin, absSize);
- gecko_resize( me.texturePath, absSize_x, absSize_y );
- me.textureExtent = gecko_get_texture_extent( me.texturePath );
-}
-
-string toStringGecko(entity me)
-{
- return me.texturePath;
-}
-
-#endif
void ListBox_draw(entity me)
{
float i;
- vector absSize, fillSize;
+ vector absSize, fillSize = '0 0 0';
vector oldshift, oldscale;
if(me.pressed == 2)
me.mouseDrag(me, me.dragScrollPos); // simulate mouseDrag event
float menuNotTheFirstFrame;
float menuMouseMode;
-void SUB_Null() { }
-
void m_sync()
{
updateCompression();
check_unacceptable_compiler_bugs();
#ifdef WATERMARK
- print(sprintf(_("^4MQC Build information: ^1%s\n"), WATERMARK()));
+ print(sprintf(_("^4MQC Build information: ^1%s\n"), WATERMARK));
#endif
// list all game dirs (TEST)
float conwidth, conheight; // "virtual" conwidth/height values for other stuff to assume for scaling
-void SUB_Null();
-
float preMenuInit(); // you have to define this for pre-menu initialization. Return 0 if initialization needs to be retried a frame later, 1 if it succeeded.
void preMenuDraw(); // this is run before the menu is drawn. You may put some stuff there that has to be done every frame.
void postMenuDraw(); // this is run just after the menu is drawn (or not). Useful to draw something over everything else.
../../menu.dat
+sys-pre.qh
../dpdefs/menudefs.qc
../dpdefs/keycodes.qc
+sys-post.qh
config.qh
../common/util-pre.qh
--- /dev/null
+#pragma noref 0
--- /dev/null
+#pragma noref 1
vector color_hslimage(vector v, vector margin)
{
- vector pos;
+ vector pos = '0 0 0';
v = rgb_to_hsl(v);
if (v_y)
{
setDependentStringNotEqual(e, strzone(strcat("hud_panel_", panelname, "_timeout")), "0");
me.TD(me, 1, 2.6, e = makeXonoticTextSlider(strzone(strcat("hud_panel_", panelname, "_timeout_effect"))));
e.addValue(e, ZCTX(_("EF^None")), "0");
- e.addValue(e, _("Slide"), "1");
- e.addValue(e, _("Alpha"), "2");
+ e.addValue(e, _("Alpha"), "1");
+ e.addValue(e, _("Slide"), "2");
e.addValue(e, ZCTX(_("EF^Both")), "3");
e.configureXonoticTextSliderValues(e);
setDependentStringNotEqual(e, strzone(strcat("hud_panel_", panelname, "_timeout")), "0");
+++ /dev/null
-#ifdef INTERFACE
-CLASS(XonoticNewsDialog) EXTENDS(XonoticDialog)
- METHOD(XonoticNewsDialog, fill, void(entity))
- ATTRIB(XonoticNewsDialog, title, string, _("News"))
- ATTRIB(XonoticNewsDialog, color, vector, SKINCOLOR_DIALOG_SETTINGS)
- ATTRIB(XonoticNewsDialog, intendedWidth, float, 0.96)
- ATTRIB(XonoticNewsDialog, rows, float, 24)
- ATTRIB(XonoticNewsDialog, columns, float, 1)
-ENDCLASS(XonoticNewsDialog)
-#endif
-
-#ifdef IMPLEMENTATION
-void XonoticNewsDialog_fill(entity me)
-{
- entity e;
- me.TR(me);
- me.TD(me, 24, 1, e = spawnGecko());
- e.configureBrowser( e, _("http://www.xonotic.org/team/blog/") );
-}
-#endif
METHOD(XonoticInputBox, setText, void(entity, string))
ATTRIB(XonoticInputBox, fontSize, float, SKINFONTSIZE_NORMAL)
ATTRIB(XonoticInputBox, image, string, SKINGFX_INPUTBOX)
- ATTRIB(XonoticInputBox, onChange, void(entity, entity), SUB_Null)
+ ATTRIB(XonoticInputBox, onChange, void(entity, entity), func_null)
ATTRIB(XonoticInputBox, onChangeEntity, entity, NULL)
- ATTRIB(XonoticInputBox, onEnter, void(entity, entity), SUB_Null)
+ ATTRIB(XonoticInputBox, onEnter, void(entity, entity), func_null)
ATTRIB(XonoticInputBox, onEnterEntity, entity, NULL)
ATTRIB(XonoticInputBox, marginLeft, float, SKINMARGIN_INPUTBOX_CHARS)
ATTRIB(XonoticInputBox, marginRight, float, SKINMARGIN_INPUTBOX_CHARS)
if(me.text != new)
{
SUPER(XonoticInputBox).setText(me, new);
- me.onChange(me, me.onChangeEntity);
+ if(me.onChange)
+ me.onChange(me, me.onChangeEntity);
if(me.saveImmediately)
me.saveCvars(me);
}
me.saveCvars(me);
r = 1;
}
- me.onEnter(me, me.onEnterEntity);
+ if(me.onEnter)
+ me.onEnter(me, me.onEnterEntity);
}
if(SUPER(XonoticInputBox).keyDown(me, key, ascii, shift))
r = 1;
{
// layout: Ping, Map name, Map name, NP, TP, MP
string s;
- float p;
float theAlpha;
float included;
// 5: AES required
{
- vector iconSize;
+ vector iconSize = '0 0 0';
iconSize_y = me.realFontSize_y * me.iconsSizeFactor;
iconSize_x = me.realFontSize_x * me.iconsSizeFactor;
- vector iconPos;
+ vector iconPos = '0 0 0';
iconPos_x = (me.columnIconsSize - 3 * iconSize_x) * 0.5;
iconPos_y = (1 - iconSize_y) * 0.5;
string campaign_name_previous;
float campaign_won_previous;
#ifdef WATERMARK
-var string autocvar_menu_watermark = WATERMARK();
+var string autocvar_menu_watermark = WATERMARK;
#else
var string autocvar_menu_watermark = "";
#endif
{
if(autocvar_menu_watermark != "")
{
- vector fs = '48 48 0';
draw_CenterText('0.5 0.1 0', sprintf(_("^1%s TEST BUILD"), autocvar_menu_watermark), globalToBoxSize('32 32 0', draw_scale), '1 1 1', 0.05, 1);
}
}
void preMenuDraw()
{
- vector fs, sz, line, mid;
+ vector fs, sz = '0 0 0', line, mid;
updateCheck();
setmodel (e, "models/ebomb.mdl");
e.movetype = MOVETYPE_NONE;
e.solid = SOLID_NOT;
- e.think = SUB_Null;
+ e.think = func_null;
e.nextthink = -1;
e.scale = 16;
}
setmodel(self,"");
self.solid = SOLID_NOT;
self.takedamage = DAMAGE_NO;
- self.event_damage = SUB_Null;
+ self.event_damage = func_null;
self.enemy = world;
self.think = zombie_spawn;
self.nextthink = time + autocvar_g_monster_zombie_respawntime;
ball.velocity = '0 0 0';
ball.movetype = MOVETYPE_NONE;
- ball.touch = SUB_Null;
+ ball.touch = func_null;
ball.effects |= EF_NOSHADOW;
ball.scale = 1; // scale down.
if (self.cnt < 2) { // step 1
if (time == self.teamtime)
bprint("The ", ColoredTeamName(self.team), " held the ball for too long.\n");
- self.touch = SUB_Null;
+ self.touch = func_null;
self.movetype = MOVETYPE_NOCLIP;
self.velocity = '0 0 0'; // just in case?
if(!self.cnt)
ball.cnt = 1;
ball.think = ResetBall;
if (ball.classname == "nexball_basketball")
- ball.touch = football_touch; // better than SUB_Null: football control until the ball gets reset
+ ball.touch = football_touch; // better than func_null: football control until the ball gets reset
ball.nextthink = time + autocvar_g_nexball_delay_goal * (self.team != GOAL_OUT);
}
void bumb_die()
{
self.health = 0;
- self.event_damage = SUB_Null;
+ self.event_damage = func_null;
self.solid = SOLID_CORPSE;
self.takedamage = DAMAGE_NO;
self.deadflag = DEAD_DYING;
float autocvar_g_jetpack_acceleration_side;
float autocvar_g_jetpack_acceleration_up;
float autocvar_g_jetpack_antigravity;
-float autocvar_g_jetpack_attenuation;
float autocvar_g_jetpack_fuel;
float autocvar_g_jetpack_maxspeed_side;
float autocvar_g_jetpack_maxspeed_up;
float autocvar_sv_vote_stop;
float autocvar_sv_vote_timeout;
float autocvar_sv_vote_wait;
+float autocvar_sv_vote_gamestart;
float autocvar_sv_warsowbunny_accel;
float autocvar_sv_warsowbunny_airforwardaccel;
float autocvar_sv_warsowbunny_backtosideratio;
if (autocvar_g_campaign && !campaign_bots_may_start)
{
- self.nextthink = time + 0.5;
+ self.bot_nextthink = time + 0.5;
return;
}
{
// block the bot during the countdown to game start
self.movement = '0 0 0';
- self.nextthink = game_starttime;
+ self.bot_nextthink = game_starttime;
return;
}
else
{
RandomSelection_Init();
- for(;;)
+ while((readfile = fgets(file)))
{
- readfile = fgets(file);
- if(!readfile)
- break;
if(substring(readfile, 0, 2) == "//")
continue;
if(substring(readfile, 0, 1) == "#")
continue;
tokens = tokenizebyseparator(readfile, "\t");
+ if(tokens == 0)
+ continue;
s = argv(0);
prio = 1;
FOR_EACH_CLIENT(p)
self.bot_nextthink = time - random();
self.lag_func = bot_lagfunc;
self.isbot = TRUE;
- self.createdtime = self.nextthink;
+ self.createdtime = self.bot_nextthink;
if(!self.bot_config_loaded) // This is needed so team overrider doesn't break between matches
bot_setnameandstuff();
return FALSE;
}
- while (1)
+ while ((s = fgets(file)))
{
- s = fgets(file);
- if (!s)
- break;
-
tokens = tokenizebyseparator(s, "*");
if (tokens!=2)
return;
}
- for (;;)
+ while ((s = fgets(file)))
{
- s = fgets(file);
- if (!s)
- break;
-
if(substring(s, 0, 2)=="//")
continue;
file = fopen(filename, FILE_READ);
if (file >= 0)
{
- while (1)
+ while ((s = fgets(file)))
{
- s = fgets(file);
- if (!s)
- break;
m1 = stov(s);
s = fgets(file);
- if (!s)
+ if not(s)
break;
m2 = stov(s);
s = fgets(file);
- if (!s)
+ if not(s)
break;
fl = stof(s);
waypoint_spawn(m1, m2, fl);
}
void Announce(string snd) {
- WriteByte(MSG_ALL, SVC_TEMPENTITY);
- WriteByte(MSG_ALL, TE_CSQC_ANNOUNCE);
- WriteString(MSG_ALL, snd);
+ WriteByte(MSG_BROADCAST, SVC_TEMPENTITY);
+ WriteByte(MSG_BROADCAST, TE_CSQC_ANNOUNCE);
+ WriteString(MSG_BROADCAST, snd);
}
void AnnounceTo(entity e, string snd) {
self.superweapons_finished = 0;
self.pushltime = 0;
self.istypefrag = 0;
- self.think = SUB_Null;
+ self.think = func_null;
self.nextthink = 0;
self.hook_time = 0;
self.runes = 0;
self.invincible_finished = 0;
self.pushltime = 0;
// players have no think function
- self.think = SUB_Null;
+ self.think = func_null;
self.nextthink = 0;
self.hook_time = 0;
self.dmg_team = 0;
DecodeLevelParms();
#ifdef WATERMARK
- sprint(self, strcat("^4SVQC Build information: ^1", WATERMARK(), "\n"));
+ sprint(self, strcat("^4SVQC Build information: ^1", WATERMARK, "\n"));
#endif
self.classname = "player_joining";
if(!sv_foginterval && world.fog != "")
stuffcmd(self, strcat("\nfog ", world.fog, "\nr_fog_exp2 0\nr_drawfog 1\n"));
- SoundEntity_Attach(self);
-
if(autocvar_g_hitplots || strstrofs(strcat(" ", autocvar_g_hitplots_individuals, " "), strcat(" ", self.netaddress, " "), 0) >= 0)
{
self.hitplotfh = fopen(strcat("hits-", matchid, "-", self.netaddress, "-", ftos(self.playerid), ".plot"), FILE_WRITE);
bprint ("^4",self.netname);
bprint ("^4 disconnected\n");
- SoundEntity_Detach(self);
-
DropAllRunes(self);
MUTATOR_CALLHOOK(ClientDisconnect);
olditems = self.items;
if((self.items & IT_USING_JETPACK) && !self.deadflag)
- {
- SoundEntity_StartSound(self, CH_TRIGGER_SINGLE, "misc/jetpack_fly.wav", VOL_BASE, autocvar_g_jetpack_attenuation);
self.modelflags |= MF_ROCKET;
- }
else
- {
- SoundEntity_StopSound(self, CH_TRIGGER_SINGLE);
self.modelflags &~= MF_ROCKET;
- }
self.effects &~= (EF_RED | EF_BLUE | EF_ADDITIVE | EF_FULLBRIGHT | EF_FLAME | EF_NODEPTHTEST);
if (intermission_running)
return; // intermission or finale
GetPressedKeys();
- } else if (self.classname == "observer") {
- //do nothing
- } else if (self.classname == "spectator") {
- //do nothing
}
#ifdef TETRIS
if((g_cts || g_race) && self.cvar_cl_allow_uidtracking == 1 && self.cvar_cl_allow_uid2name == 1)
{
- if(!self.stored_netname)
+ if not(self.stored_netname)
self.stored_netname = strzone(uid2name(self.crypto_idfp));
if(self.stored_netname != self.netname)
{
url_fputs(fh, "#begin statsfile\n");
url_fputs(fh, strcat("#date ", strftime(TRUE, "%a %b %e %H:%M:%S %Z %Y"), "\n"));
#ifdef WATERMARK
- url_fputs(fh, strcat("#version ", WATERMARK(), "\n"));
+ url_fputs(fh, strcat("#version ", WATERMARK, "\n"));
#endif
url_fputs(fh, strcat("#config ", ftos(crc16(FALSE, cvar_purechanges)), "\n"));
url_fputs(fh, strcat("#cvar_purechanges ", ftos(cvar_purechanges_count), "\n"));
vector W_CalculateProjectileSpread(vector forward, float spread)
{
float sigma;
- vector v1, v2;
+ vector v1 = '0 0 0', v2;
float dx, dy, r;
float sstyle;
spread *= g_weaponspreadfactor;
{
if(caller) { caller.allowed_timeouts -= 1; }
- bprint(GetCallerName(caller), " ^7called a timeout", (caller ? strcat(" (", ftos(caller.allowed_timeouts), " timeout(s) left)") : string_null), "!\n"); // write a bprint who started the timeout (and how many they have left)
+ bprint(GetCallerName(caller), " ^7called a timeout", (caller ? strcat(" (", ftos(caller.allowed_timeouts), " timeout(s) left)") : ""), "!\n"); // write a bprint who started the timeout (and how many they have left)
timeout_status = TIMEOUT_LEADTIME;
timeout_caller = caller;
string separator = strreplace("%", " ", strcat((argv(1) ? argv(1) : " "), "^7"));
string tmp_netaddress, tmp_crypto_idfp;
- print_to(caller, strcat("List of client information", (privacy ? " (some data is hidden for privacy)" : string_null), ":"));
+ print_to(caller, strcat("List of client information", (privacy ? " (some data is hidden for privacy)" : ""), ":"));
print_to(caller, sprintf(strreplace(" ", separator, " %-4s %-20s %-5s %-3s %-9s %-16s %s "),
"ent", "nickname", "ping", "pl", "time", "ip", "crypto_id"));
case CMD_REQUEST_COMMAND:
{
entity tmp_entity;
- float i;
- vector v;
if(argc >= 4)
{
strcat("^2:^1", ftos(vote_reject_count)),
((mincount >= 0) ? strcat("^2 (^1", ftos(mincount), "^2 needed)") : "^2"),
strcat(", ^1", ftos(vote_abstain_count), "^2 didn't care"),
- strcat(", ^1", ftos(notvoters), strcat("^2 didn't ", ((mincount >= 0) ? string_null : "have to "), "vote\n"))));
+ strcat(", ^1", ftos(notvoters), strcat("^2 didn't ", ((mincount >= 0) ? "" : "have to "), "vote\n"))));
if(autocvar_sv_eventlog)
{
{
validated_map = MapInfo_FixName(validated_map);
- if(!validated_map)
+ if not(validated_map)
{
print_to(caller, "This map is not available on this server.");
return string_null;
vote_command = VoteCommand_extractcommand(vote_command, 2, argc);
if not(autocvar_sv_vote_call || !caller) { print_to(caller, "^1Vote calling is not allowed."); }
+ else if(!autocvar_sv_vote_gamestart && time < game_starttime) { print_to(caller, "^1Vote calling is not allowed before the match has started."); }
else if(vote_called) { print_to(caller, "^1There is already a vote called."); }
else if(!spectators_allowed && (caller && (caller.classname != "player"))) { print_to(caller, "^1Only players can call a vote."); }
else if(timeout_status) { print_to(caller, "^1You can not call a vote while a timeout is active."); }
#define ACTIVE_BUSY 2
#define ACTIVE_TOGGLE 3
.float active;
-.float (float act_state) setactive;
+.void (float act_state) setactive;
.entity realowner;
.float nex_charge;
self.cnt = -1;
- if(!self.message)
+ if(self.message == "")
self.message = " has captured a control point";
if(self.DOMPOINTFRAGS <= 0)
self.health = self.max_health;
self.takedamage = DAMAGE_NO;
self.bot_attack = FALSE;
- self.event_damage = SUB_Null;
+ self.event_damage = func_null;
self.state = 1;
func_breakable_colormod();
}
if(self.count == 0)
self.count = 1;
- if(!self.message)
+ if(self.message == "")
self.message = "got too close to an explosion";
- if(!self.message2)
+ if(self.message2 == "")
self.message2 = "was pushed into an explosion by";
if(!self.dmg_radius)
self.dmg_radius = 150;
void Send_KillNotification (string s1, string s2, string s3, float msg, float type)
{
- WriteByte(MSG_ALL, SVC_TEMPENTITY);
- WriteByte(MSG_ALL, TE_CSQC_KILLNOTIFY);
- WriteString(MSG_ALL, s1);
- WriteString(MSG_ALL, s2);
- WriteString(MSG_ALL, s3);
- WriteShort(MSG_ALL, msg);
- WriteByte(MSG_ALL, type);
+ WriteByte(MSG_BROADCAST, SVC_TEMPENTITY);
+ WriteByte(MSG_BROADCAST, TE_CSQC_KILLNOTIFY);
+ WriteString(MSG_BROADCAST, s1);
+ WriteString(MSG_BROADCAST, s2);
+ WriteString(MSG_BROADCAST, s3);
+ WriteShort(MSG_BROADCAST, msg);
+ WriteByte(MSG_BROADCAST, type);
}
// Function is used to send a generic centerprint whose content CSQC gets to decide (gentle version or not in the below cases)
void Obituary (entity attacker, entity inflictor, entity targ, float deathtype)
{
string s, a, msg;
- float w, type;
+ float type;
if (targ.classname == "player")
{
self.state = 1;
self.think = GrapplingHookThink;
self.nextthink = time;
- self.touch = SUB_Null;
+ self.touch = func_null;
self.velocity = '0 0 0';
self.movetype = MOVETYPE_NONE;
self.hook_length = -1;
setorigin (self, self.origin);
//self.pflags = PFLAGS_FULLDYNAMIC;
self.solid = SOLID_NOT;
- //self.blocked = SUB_Null;
+ //self.blocked = func_null;
//if (self.spawnflags & DNOSHADOW)
// self.pflags = self.pflags + PFLAGS_NOSHADOW;
//if (self.spawnflags & START_OFF)
-void SUB_Null() {}
-float SUB_True() { return 1; }
-float SUB_False() { return 0; }
+void SUB_NullThink(void) { }
void(vector destangle, float tspeed, void() func) SUB_CalcAngleMove;
void() SUB_CalcMoveDone;
controller.think1 = self.think;
// the thinking is now done by the controller
- self.think = SUB_Null;
+ self.think = SUB_NullThink; // for PushMove
self.nextthink = self.ltime + traveltime;
// invoke controller
if(clienttype(activator) == CLIENTTYPE_REAL)
{
centerprint (activator, self.message);
- if (!self.noise)
+ if (self.noise == "")
play2(activator, "misc/talk.wav");
}
}
else
{ // we can't just remove (self) here, because this is a touch function
// called wheil C code is looping through area links...
- self.touch = SUB_Null;
+ self.touch = func_null;
}
}
self.takedamage = DAMAGE_YES;
self.solid = SOLID_BBOX;
}
- self.think = SUB_Null;
+ self.think = func_null;
+ self.nextthink = 0;
self.team = self.team_saved;
}
void delay_reset()
{
- self.think = SUB_Null;
+ self.think = func_null;
+ self.nextthink = 0;
}
void spawnfunc_trigger_delay()
self.enemy = world; // I hate you all
if (!self.dmg)
self.dmg = 1000;
- if (!self.message)
+ if (self.message == "")
self.message = "was in the wrong place";
- if (!self.message2)
+ if (self.message2 == "")
self.message2 = "was thrown into a world of hurt by";
// self.message = "someone like %s always gets wrongplaced";
if(self.colormod == '0 0 0')
if(!self.alpha)
self.colormod = '1 0 0';
- if(!self.message)
+ if(self.message == "")
self.message = "saw the light";
- if (!self.message2)
+ if (self.message2 == "")
self.message2 = "was pushed into a laser by";
if(!self.scale)
self.scale = 1;
if(autocvar_g_campaign)
CampaignPreIntermission();
+ MUTATOR_CALLHOOK(MatchEnd);
+
localcmd("\nsv_hook_gameend\n");
}
if(mapvote_initialized)
return "Can't suggest - voting is already in progress!";
m = MapInfo_FixName(m);
- if(!m)
+ if not(m)
return "The map you suggested is not available on this server.";
if(!autocvar_g_maplist_votable_suggestions_override_mostrecent)
if(Map_IsRecent(m))
if(ban_idfp == s) return TRUE;
}
if(ipbanned)
- if(!autocvar_g_banned_list_idmode || !ban_idfp)
+ {
+ if(!autocvar_g_banned_list_idmode)
+ return TRUE;
+ if not(ban_idfp)
return TRUE;
+ }
return FALSE;
}
_netname = "FLUFFY PINK keycard";
_colormod = '1 1 1';
- if (!self.netname) {
+ if (self.netname == "") {
objerror("item_key doesn't have a default name for this key and a custom one was not specified!");
remove(self);
return;
_model = "models/keys/key.md3";
} else if (self.itemkeys >= ITEM_KEY_BIT(3) && self.itemkeys <= ITEM_KEY_BIT(5)) {
_model = "models/keys/key.md3"; // FIXME: replace it by a keycard model!
- } else if (!self.model) {
+ } else if (self.model == "") {
objerror("item_key doesn't have a default model for this key and a custom one was not specified!");
remove(self);
return;
}
// set defailt netname
- if (!self.netname)
+ if (self.netname == "")
self.netname = _netname;
// set default colormod
self.colormod = _colormod;
// set default model
- if (!self.model)
+ if (self.model == "")
self.model = _model;
// set default pickup message
- if (!self.message)
+ if (self.message == "")
self.message = strzone(strcat("You've picked up the ", self.netname, "!"));
- if (!self.noise)
+ if (self.noise == "")
self.noise = "misc/itempickup.wav";
// save the name for later
}
// set unlocked message
- if (!self.message)
+ if (self.message == "")
self.message = "Unlocked!";
// set default unlock noise
- if (!self.noise) {
+ if (self.noise == "") {
if (self.sounds == 1)
self.noise = "misc/secret.wav";
else if (self.sounds == 2)
}
// set default use key sound
- if (!self.noise1)
+ if (self.noise1 == "")
self.noise1 = "misc/decreasevalue.wav";
// set closed sourd
- if (!self.noise2)
+ if (self.noise2 == "")
self.noise2 = "misc/talk.wav";
// delay between triggering message2 and trigger2
else replacement = "batteries"; // ;)
} else if (escape == "x") {
replacement = cursor_ent.netname;
- if (!replacement || !cursor_ent)
+ if (replacement == "" || !cursor_ent)
replacement = "nothing";
} else if (escape == "s")
replacement = ftos(vlen(self.velocity - self.velocity_z * '0 0 1'));
precache_sound ("player/lava.wav");
precache_sound ("player/slime.wav");
- if (g_jetpack)
- precache_sound ("misc/jetpack_fly.wav");
-
precache_model ("models/sprites/0.spr32");
precache_model ("models/sprites/1.spr32");
precache_model ("models/sprites/2.spr32");
self = e_old;
}
//dprint("Delayed initialization: ", self.classname, "\n");
- if(func != func_null)
+ if(func)
func();
else
{
.float uncustomizeentityforclient_set;
.void(void) uncustomizeentityforclient;
-void(void) SUB_Nullpointer = #0;
void UncustomizeEntitiesRun()
{
entity oldself;
{
e.customizeentityforclient = customizer;
e.uncustomizeentityforclient = uncustomizer;
- e.uncustomizeentityforclient_set = (uncustomizer != SUB_Nullpointer);
+ e.uncustomizeentityforclient_set = !!uncustomizer;
}
.float nottargeted;
return gettaginfo(gettaginfo_relative_ent, tag);
}
-void SoundEntity_StartSound(entity pl, float chan, string samp, float vol, float attn)
-{
- float p;
- p = pow(2, chan);
- if (pl.soundentity.cnt & p)
- return;
- soundtoat(MSG_ALL, pl.soundentity, gettaginfo(pl.soundentity, 0), chan, samp, vol, attn);
- pl.soundentity.cnt |= p;
-}
-
-void SoundEntity_StopSound(entity pl, float chan)
-{
- float p;
- p = pow(2, chan);
- if (pl.soundentity.cnt & p)
- {
- stopsoundto(MSG_ALL, pl.soundentity, chan);
- pl.soundentity.cnt &~= p;
- }
-}
-
-void SoundEntity_Attach(entity pl)
-{
- pl.soundentity = spawn();
- pl.soundentity.classname = "soundentity";
- pl.soundentity.owner = pl;
- setattachment(pl.soundentity, pl, "");
- setmodel(pl.soundentity, "null");
-}
-
-void SoundEntity_Detach(entity pl)
-{
- float i;
- for (i = 0; i <= 7; ++i)
- SoundEntity_StopSound(pl, i);
-}
-
.float scale2;
float modeleffect_SendEntity(entity to, float sf)
{
if(name == loaded_mutators[i])
return 1; // already added
- if(!loaded_mutators[i])
+ if not(loaded_mutators[i])
j = i;
}
if(j < 0)
flag.solid = SOLID_NOT;
flag.nextthink = FALSE; // stop thinking
- print("stopping the ", flag.netname, " from moving.\n");
+ //dprint("stopping the ", flag.netname, " from moving.\n");
break;
}
self.velocity = '0 0 0';
self.movetype = MOVETYPE_NONE;
self.effects |= EF_NODRAW;
- self.touch = SUB_Null;
+ self.touch = func_null;
self.think = ka_TimeScoring;
self.nextthink = time + autocvar_g_keepaway_score_timeinterval;
self.takedamage = DAMAGE_NO;
ball.velocity = '0 0 0';
ball.movetype = MOVETYPE_NONE;
- ball.touch = SUB_Null;
+ ball.touch = func_null;
ball.effects |= EF_NOSHADOW;
ball.scale = 1; // scale down.
{
if(time == self.teamtime)
bprint("The ", ColoredTeamName(self.team), " held the ball for too long.\n");
- self.touch = SUB_Null;
+ self.touch = func_null;
self.movetype = MOVETYPE_NOCLIP;
self.velocity = '0 0 0'; // just in case?
if(!self.cnt)
ball.cnt = 1;
ball.think = ResetBall;
if(ball.classname == "nexball_basketball")
- ball.touch = football_touch; // better than SUB_Null: football control until the ball gets reset
+ ball.touch = football_touch; // better than func_null: football control until the ball gets reset
ball.nextthink = time + autocvar_g_nexball_delay_goal * (self.team != GOAL_OUT);
}
{
entity ball, attacker;
attacker = self.owner;
- //self.think = SUB_Null;
+ //self.think = func_null;
//self.enemy = world;
PROJECTILE_TOUCH;
missile.flags = FL_PROJECTILE;
}
-var const float() nullfunc;
float ball_customize()
{
if(!self.owner)
{
self.effects &~= EF_FLAME;
self.scale = 1;
- self.customizeentityforclient = nullfunc;
+ self.customizeentityforclient = func_null;
return TRUE;
}
self.islinked = FALSE;
self.isshielded = FALSE;
self.takedamage = DAMAGE_NO; // can't be hurt anymore
- self.event_damage = SUB_Null; // won't do anything if hurt
+ self.event_damage = func_null; // won't do anything if hurt
self.count = 0; // reset counter
self.think = onslaught_generator_deaththink; // explosion sequence
self.nextthink = time; // start exploding immediately
self.isshielded = TRUE;
self.enemy.solid = SOLID_NOT;
self.enemy.colormap = self.colormap;
- self.think = self.enemy.think = SUB_Null;
- self.nextthink = 0; // don't like SUB_Null :P
+ self.think = self.enemy.think = func_null;
+ self.nextthink = 0; // don't like func_null :P
setmodel(self, "models/onslaught/controlpoint_pad.md3");
//setsize(self, '-32 -32 0', '32 32 8');
#endif
var vector pathlib_movenode(vector start,vector end,float doedge);
-vector pathlib_wateroutnode(vector start,vector end)
+vector pathlib_wateroutnode(vector start,vector end,float doedge)
{
vector surface;
return end;
}
-vector pathlib_swimnode(vector start,vector end)
+vector pathlib_swimnode(vector start,vector end,float doedge)
{
pathlib_movenode_goodnode = 0;
-vector pathlib_wateroutnode(vector start,vector end)
+vector pathlib_wateroutnode(vector start,vector end, float doedge)
{
vector surface;
return end;
}
-vector pathlib_swimnode(vector start,vector end)
+vector pathlib_swimnode(vector start,vector end, float doedge)
{
pathlib_movenode_goodnode = 0;
end_y = fsnap(end_y, pathlib_gridsize);
if(pointcontents(end) == CONTENT_EMPTY)
- return pathlib_wateroutnode( start, end);
+ return pathlib_wateroutnode( start, end, doedge);
tracebox(start, movenode_boxmin,movenode_boxmax, end, MOVE_WORLDONLY, self);
if(trace_fraction == 1)
return end;
}
-vector pathlib_flynode(vector start,vector end)
+vector pathlib_flynode(vector start,vector end, float doedge)
{
pathlib_movenode_goodnode = 0;
vector movenode_boxmin;
float pathlib_movenode_goodnode;
-vector pathlib_wateroutnode(vector start, vector end);
-vector pathlib_swimnode(vector start, vector end);
-vector pathlib_flynode(vector start, vector end);
+vector pathlib_wateroutnode(vector start, vector end, float doedge);
+vector pathlib_swimnode(vector start, vector end, float doedge);
+vector pathlib_flynode(vector start, vector end, float doedge);
vector pathlib_walknode(vector start, vector end, float doedge);
var vector pathlib_movenode(vector start, vector end, float doedge);
else if(clienttype(e) == CLIENTTYPE_BOT)
s = sprintf("bot#%g#%s", skill, e.cleanname);
- if(!s || find(world, playerstats_id, s)) // already have one of the ID - next one can't be tracked then!
+ if((s == "") || find(world, playerstats_id, s)) // already have one of the ID - next one can't be tracked then!
{
if(clienttype(e) == CLIENTTYPE_BOT)
s = sprintf("bot#%d", e.playerid);
void PlayerStats_Event(entity e, string event_id, float value)
{
- if(!e.playerstats_id || playerstats_db < 0)
+ if((e.playerstats_id == "") || playerstats_db < 0)
return;
string key;
case URL_READY_CANWRITE:
url_fputs(fh, "V 5\n");
#ifdef WATERMARK
- url_fputs(fh, sprintf("R %s\n", WATERMARK()));
+ url_fputs(fh, sprintf("R %s\n", WATERMARK));
#endif
url_fputs(fh, sprintf("T %s.%06d\n", strftime(FALSE, "%s"), floor(random() * 1000000)));
url_fputs(fh, sprintf("G %s\n", GetGametype()));
{
if(playerstats_db < 0)
return;
- if(!p.playerstats_id || playerstats_db < 0)
+ if((p.playerstats_id == "") || playerstats_db < 0)
return;
p.playerstats_addedglobalinfo = TRUE;
p.playerstats_id = string_null;
}
+.float scoreboard_pos;
void PlayerStats_EndMatch(float finished)
{
- entity p, winner;
- winner = PlayerScore_Sort(score_dummyfield);
- FOR_EACH_CLIENT(p) // spectators intentionally not included
+ entity p;
+ PlayerScore_Sort(score_dummyfield, 0);
+ PlayerScore_Sort(scoreboard_pos, 1);
+ FOR_EACH_CLIENT(p)
{
//PlayerStats_Accuracy(p); // stats are already written with PlayerStats_AddGlobalInfo(entity), don't double them up.
if((g_arena || g_lms || g_ca) && (p.alivetime <= 0)) { continue; }
else if(p.classname != "player") { continue; }
- float latency = (p.latency_sum / p.latency_cnt);
- if(latency) { PlayerStats_Event(p, PLAYERSTATS_AVGLATENCY, latency); }
+ if(clienttype(p) == CLIENTTYPE_REAL)
+ {
+ if(p.latency_cnt)
+ {
+ float latency = (p.latency_sum / p.latency_cnt);
+ if(latency) { PlayerStats_Event(p, PLAYERSTATS_AVGLATENCY, latency); }
+ }
+ }
PlayerScore_PlayerStats(p);
PlayerStats_Event(p, PLAYERSTATS_SCOREBOARD_VALID, 1);
PlayerStats_Event(p, PLAYERSTATS_WINS, p.winning);
PlayerStats_Event(p, PLAYERSTATS_MATCHES, 1);
PlayerStats_Event(p, PLAYERSTATS_RANK, p.score_dummyfield);
+ PlayerStats_Event(p, PLAYERSTATS_SCOREBOARD_POS, p.scoreboard_pos);
}
}
}
string PLAYERSTATS_JOINS = "joins";
string PLAYERSTATS_SCOREBOARD_VALID = "scoreboardvalid";
string PLAYERSTATS_RANK = "rank";
+string PLAYERSTATS_SCOREBOARD_POS = "scoreboardpos";
string PLAYERSTATS_TOTAL = "total-";
string PLAYERSTATS_SCOREBOARD = "scoreboard-";
{
portal.skin = 2;
portal.solid = SOLID_NOT;
- portal.touch = SUB_Null;
- portal.think = SUB_Null;
+ portal.touch = func_null;
+ portal.think = func_null;
portal.effects = 0;
portal.nextthink = 0;
portal.takedamage = DAMAGE_NO;
{
portal.skin = 2;
portal.solid = SOLID_NOT;
- portal.touch = SUB_Null;
- portal.think = SUB_Null;
+ portal.touch = func_null;
+ portal.think = func_null;
portal.effects = EF_ADDITIVE;
portal.nextthink = 0;
portal.takedamage = DAMAGE_YES;
{
portal.skin = 1;
portal.solid = SOLID_NOT;
- portal.touch = SUB_Null;
- portal.think = SUB_Null;
+ portal.touch = func_null;
+ portal.think = func_null;
portal.effects = EF_STARDUST | EF_BLUE;
portal.nextthink = 0;
portal.takedamage = DAMAGE_YES;
waypoint_spawnforitem_force(self, trace_endpos);
self.nearestwaypointtimeout = time + 1000000000;
- if(!self.message)
+ if(self.message == "")
self.message = "went backwards";
- if (!self.message2)
+ if (self.message2 == "")
self.message2 = "was pushed backwards by";
- if (!self.race_penalty_reason)
+ if (self.race_penalty_reason == "")
self.race_penalty_reason = "missing a checkpoint";
self.race_checkpoint = self.cnt;
waypoint_spawnforitem_force(self, trace_endpos);
self.nearestwaypointtimeout = time + 1000000000;
- if(!self.message)
+ if(self.message == "")
self.message = "went backwards";
- if (!self.message2)
+ if (self.message2 == "")
self.message2 = "was pushed backwards by";
- if (!self.race_penalty_reason)
+ if (self.race_penalty_reason == "")
self.race_penalty_reason = "missing a checkpoint";
if(self.classname == "target_startTimer")
Score_NicePrint(world);
race_ClearRecords();
- PlayerScore_Sort(race_place);
+ PlayerScore_Sort(race_place, 1);
entity e;
FOR_EACH_CLIENT(e)
if not(self.spawnflags & 1)
self.touch = penalty_touch;
- if (!self.race_penalty_reason)
+ if (self.race_penalty_reason == "")
self.race_penalty_reason = "missing a checkpoint";
if (!self.race_penalty)
self.race_penalty = 5;
void RuneCarriedThink()
{
float rcount, rnum;
- vector ang;
+ vector ang = '0 0 0';
entity rune;
if(self.owner.classname != "player" || time < game_starttime)
other.runes = other.runes | self.runes | self.enemy.runes;
- //self.think = SUB_Null;
+ //self.think = func_null;
//self.nextthink = 0;
self.think = RuneCarriedThink;
self.nextthink = time;
- self.touch = SUB_Null;
+ self.touch = func_null;
self.solid = SOLID_NOT;
setorigin(self, self.origin);
float scores_flags_primary;
float teamscores_flags_primary;
-vector ScoreField_Compare(entity t1, entity t2, .float field, float fieldflags, vector previous) // returns: cmp value, best prio
+vector ScoreField_Compare(entity t1, entity t2, .float field, float fieldflags, vector previous, float strict) // returns: cmp value, best prio
{
- if(!(fieldflags & SFL_SORT_PRIO_MASK)) // column does not sort
+ if(!strict && !(fieldflags & SFL_SORT_PRIO_MASK)) // column does not sort
return previous;
if(fieldflags & SFL_SORT_PRIO_MASK < previous_y)
return previous;
return TeamScore_AddToTeam(player.team, scorefield, score);
}
-float TeamScore_Compare(entity t1, entity t2)
+float TeamScore_Compare(entity t1, entity t2, float strict)
{
if(!t1 || !t2) return (!t2) - !t1;
{
var .float f;
f = teamscores[i];
- result = ScoreField_Compare(t1, t2, f, teamscores_flags[i], result);
+ result = ScoreField_Compare(t1, t2, f, teamscores_flags[i], result, strict);
}
+
+ if (result_x == 0 && strict)
+ result_x = t1.team - t2.team;
+
return result_x;
}
return r;
}
-float PlayerScore_Compare(entity t1, entity t2)
+float PlayerScore_Compare(entity t1, entity t2, float strict)
{
if(!t1 || !t2) return (!t2) - !t1;
{
var .float f;
f = scores[i];
- result = ScoreField_Compare(t1, t2, f, scores_flags[i], result);
+ result = ScoreField_Compare(t1, t2, f, scores_flags[i], result, strict);
}
+
+ if (result_x == 0 && strict)
+ result_x = num_for_edict(t1.owner) - num_for_edict(t2.owner);
+
return result_x;
}
for(t = 0; t < 16; ++t)
{
sk = teamscorekeepers[t];
- c = TeamScore_Compare(winnerscorekeeper, sk);
+ c = TeamScore_Compare(winnerscorekeeper, sk, 1);
if(c < 0)
{
WinningConditionHelper_secondteam = WinningConditionHelper_winnerteam;
}
else
{
- c = TeamScore_Compare(secondscorekeeper, sk);
+ c = TeamScore_Compare(secondscorekeeper, sk, 1);
if(c < 0)
{
WinningConditionHelper_secondteam = t + 1;
}
}
- WinningConditionHelper_equality = (TeamScore_Compare(winnerscorekeeper, secondscorekeeper) == 0);
+ WinningConditionHelper_equality = (TeamScore_Compare(winnerscorekeeper, secondscorekeeper, 0) == 0);
if(WinningConditionHelper_equality)
WinningConditionHelper_winnerteam = WinningConditionHelper_secondteam = -1;
FOR_EACH_PLAYER(p)
{
sk = p.scorekeeper;
- c = PlayerScore_Compare(winnerscorekeeper, sk);
+ c = PlayerScore_Compare(winnerscorekeeper, sk, 1);
if(c < 0)
{
WinningConditionHelper_second = WinningConditionHelper_winner;
}
else
{
- c = PlayerScore_Compare(secondscorekeeper, sk);
+ c = PlayerScore_Compare(secondscorekeeper, sk, 1);
if(c < 0)
{
WinningConditionHelper_second = p;
}
}
- WinningConditionHelper_equality = (PlayerScore_Compare(winnerscorekeeper, secondscorekeeper) == 0);
+ WinningConditionHelper_equality = (PlayerScore_Compare(winnerscorekeeper, secondscorekeeper, 0) == 0);
if(WinningConditionHelper_equality)
WinningConditionHelper_winner = WinningConditionHelper_second = world;
return out;
}
-float PlayerTeamScore_Compare(entity p1, entity p2)
+float PlayerTeamScore_Compare(entity p1, entity p2, float strict)
{
if(teamscores_entities_count)
if(p1.team != p2.team)
float r;
t1 = teamscorekeepers[p1.team - 1];
t2 = teamscorekeepers[p2.team - 1];
- r = TeamScore_Compare(t1, t2);
- if(r == 0) // ensure a deterministic order
- r = p1.team - p2.team;
+ r = TeamScore_Compare(t1, t2, strict);
return r;
}
- return PlayerScore_Compare(p1.scorekeeper, p2.scorekeeper);
+ return PlayerScore_Compare(p1.scorekeeper, p2.scorekeeper, strict);
}
-entity PlayerScore_Sort(.float field)
+entity PlayerScore_Sort(.float field, float strict)
{
entity p, plist, pprev, pbest, pbestprev, pfirst, plast;
- float i;
+ float i, j;
plist = world;
pfirst = plast = world;
- i = 0;
+ i = j = 0;
while(plist)
{
pprev = pbestprev = world;
pbest = plist;
for(p = plist; (pprev = p), (p = p.chain); )
{
- if(PlayerTeamScore_Compare(p, pbest) > 0)
+ if(PlayerTeamScore_Compare(p, pbest, strict) > 0)
{
pbest = p;
pbestprev = pprev;
pbestprev.chain = pbest.chain;
pbest.chain = world;
- pbest.field = ++i;
+ ++i;
+ if(!plast || PlayerTeamScore_Compare(plast, pbest, 0))
+ j = i;
+
+ pbest.field = j;
if not(pfirst)
pfirst = pbest;
++t;
w = bound(6, floor(SCORESWIDTH / t - 1), 9);
- p = PlayerScore_Sort(score_dummyfield);
+ p = PlayerScore_Sort(score_dummyfield, 1);
t = -1;
if(!teamscores_entities_count)
* 1. Non-players get 0 written into that field.
* Returns the beginning of a sorted chain of the non-spectators.
*/
-entity PlayerScore_Sort(.float field);
+entity PlayerScore_Sort(.float field, float strict);
// take over the touch() function, so we can mark secret as found
self.touch = trigger_secret_touch;
// ignore triggering;
- self.use = SUB_Null;
+ self.use = func_null;
}
{
self.dmgtime = time + autocvar_g_balance_contents_damagerate;
- if (!projectile)
+ if (projectile)
+ {
+ if (self.watertype == CONTENT_LAVA)
+ {
+ Damage (self, world, world, autocvar_g_balance_contents_projectiledamage * autocvar_g_balance_contents_damagerate * self.waterlevel, DEATH_LAVA, self.origin, '0 0 0');
+ }
+ else if (self.watertype == CONTENT_SLIME)
+ {
+ Damage (self, world, world, autocvar_g_balance_contents_projectiledamage * autocvar_g_balance_contents_damagerate * self.waterlevel, DEATH_SLIME, self.origin, '0 0 0');
+ }
+ }
+ else
{
if (self.watertype == CONTENT_LAVA)
{
Damage (self, world, world, autocvar_g_balance_contents_playerdamage_slime * autocvar_g_balance_contents_damagerate * self.waterlevel, DEATH_SLIME, self.origin, '0 0 0');
}
}
- else if ((self.watertype == CONTENT_LAVA) || (self.watertype == CONTENT_SLIME))
- {
- Damage (self, world, world, autocvar_g_balance_contents_projectiledamage * autocvar_g_balance_contents_damagerate * self.waterlevel, DEATH_SLIME, self.origin, '0 0 0');
- }
}
}
else
rgb = '1 0 0';
}
}
- if(!name)
- {
- print("Unknown powerup-marked item is wanting to respawn\n");
- localcmd(sprintf("prvm_edict server %d\n", num_for_edict(self)));
- }
if(name)
{
WaypointSprite_Spawn(name, 0, 0, self, '0 0 64', world, 0, self, waypointsprite_attached, TRUE, RADARICON_POWERUP, rgb);
if(self.waypointsprite_attached)
WaypointSprite_UpdateBuildFinished(self.waypointsprite_attached, time + ITEM_RESPAWN_TICKS);
}
+ else
+ {
+ print("Unknown powerup-marked item is wanting to respawn\n");
+ localcmd(sprintf("prvm_edict server %d\n", num_for_edict(self)));
+ }
}
sound (self, CH_TRIGGER, "misc/itemrespawncountdown.wav", VOL_BASE, ATTN_NORM); // play respawn sound
if(self.waypointsprite_attached)
if(self.classname != "droppedweapon")
{
- self.think = SUB_Null;
+ self.think = func_null;
self.nextthink = 0;
if(self.waypointsprite_attached)
if (self.spawnflags & PUSH_ONCE)
{
- self.touch = SUB_Null;
+ self.touch = func_null;
self.think = SUB_Remove;
self.nextthink = time;
}
void plat_use()
{
- self.use = SUB_Null;
+ self.use = func_null;
if (self.state != 4)
objerror ("plat_use: not in up state");
plat_go_down();
if(self.spawnflags & 4)
self.dmg = 10000;
- if(self.dmg && (!self.message))
+ if(self.dmg && (self.message == ""))
self.message = "was squished";
- if(self.dmg && (!self.message2))
+ if(self.dmg && (self.message2 == ""))
self.message2 = "was squished by";
if (self.sounds == 1)
targ = find(world, targetname, self.target);
self.enemy = targ;
self.target = targ.target;
- if (!self.target)
+ if (self.target == "")
objerror("train_next: no next target");
self.wait = targ.wait;
if (!self.wait)
entity targ;
targ = find(world, targetname, self.target);
self.target = targ.target;
- if (!self.target)
+ if (self.target == "")
objerror("func_train_find: no next target");
setorigin(self, targ.origin - self.mins);
self.nextthink = self.ltime + 1;
if (self.noise != "")
precache_sound(self.noise);
- if (!self.target)
+ if (self.target == "")
objerror("func_train without a target");
if (!self.speed)
self.speed = 100;
InitializeEntity(self, func_train_find, INITPRIO_SETLOCATION);
self.blocked = generic_plat_blocked;
- if(self.dmg & (!self.message))
+ if(self.dmg && (self.message == ""))
self.message = " was squished";
- if(self.dmg && (!self.message2))
+ if(self.dmg && (self.message2 == ""))
self.message2 = "was squished by";
if(self.dmg && (!self.dmgtime))
self.dmgtime = 0.25;
self.pos1 = self.avelocity;
- if(self.dmg & (!self.message))
+ if(self.dmg && (self.message == ""))
self.message = " was squished";
- if(self.dmg && (!self.message2))
+ if(self.dmg && (self.message2 == ""))
self.message2 = "was squished by";
// wait for targets to spawn
self.nextthink = self.ltime + 999999999;
- self.think = SUB_Null;
+ self.think = SUB_NullThink; // for PushMove
// TODO make a reset function for this one
}
// damage when blocked
self.blocked = generic_plat_blocked;
- if(self.dmg & (!self.message))
+ if(self.dmg && (self.message == ""))
self.message = " was squished";
- if(self.dmg && (!self.message2))
+ if(self.dmg && (self.message2 == ""))
self.message2 = "was squished by";
if(self.dmg && (!self.dmgtime))
self.dmgtime = 0.25;
controller.nextthink = time + 1;
controller.think = func_bobbing_controller_think;
self.nextthink = self.ltime + 999999999;
- self.think = SUB_Null;
+ self.think = SUB_NullThink; // for PushMove
// Savage: Reduce bandwith, critical on e.g. nexdm02
self.effects |= EF_LOWPRECISION;
self.speed = 30;
// not initializing self.dmg to 2, to allow damageless pendulum
- if(self.dmg & (!self.message))
+ if(self.dmg && (self.message == ""))
self.message = " was squished";
- if(self.dmg && (!self.message2))
+ if(self.dmg && (self.message2 == ""))
self.message2 = "was squished by";
if(self.dmg && (!self.dmgtime))
self.dmgtime = 0.25;
controller.nextthink = time + 1;
controller.think = func_pendulum_controller_think;
self.nextthink = self.ltime + 999999999;
- self.think = SUB_Null;
+ self.think = SUB_NullThink; // for PushMove
//self.effects |= EF_LOWPRECISION;
{
if(t.health && !self.health)
self.health = t.health;
- if(t.targetname && !self.targetname)
+ if((t.targetname != "") && (self.targetname == ""))
self.targetname = t.targetname;
- if(t.message != "" && self.message == "")
+ if((t.message != "") && (self.message == ""))
self.message = t.message;
if (t.absmin_x < cmins_x)
cmins_x = t.absmin_x;
setorigin(self, self.pos1);
self.velocity = '0 0 0';
self.state = STATE_BOTTOM;
- self.think = SUB_Null;
+ self.think = func_null;
+ self.nextthink = 0;
}
// spawnflags require key (for now only func_door)
// if(self.spawnflags & 8)
// self.dmg = 10000;
- if(self.dmg && (!self.message))
+ if(self.dmg && (self.message == ""))
self.message = "was squished";
- if(self.dmg && (!self.message2))
+ if(self.dmg && (self.message2 == ""))
self.message2 = "was squished by";
if (self.sounds > 0)
self.angles = self.pos1;
self.avelocity = '0 0 0';
self.state = STATE_BOTTOM;
- self.think = SUB_Null;
+ self.think = func_null;
+ self.nextthink = 0;
}
void door_rotating_init_startopen()
if(self.spawnflags & 8)
self.dmg = 10000;
- if(self.dmg && (!self.message))
+ if(self.dmg && (self.message == ""))
self.message = "was squished";
- if(self.dmg && (!self.message2))
+ if(self.dmg && (self.message2 == ""))
self.message2 = "was squished by";
if (self.sounds > 0)
float SECRET_NO_SHOOT = 8; // only opened by trigger
float SECRET_YES_SHOOT = 16; // shootable even if targeted
-
void fd_secret_use()
{
float temp;
sound(self, CH_TRIGGER_SINGLE, self.noise2, VOL_BASE, ATTN_NORM);
}
+void fd_secret_damage(entity inflictor, entity attacker, float damage, float deathtype, vector hitloc, vector force)
+{
+ fd_secret_use();
+}
+
// Wait after first movement...
void fd_secret_move1()
{
self.takedamage = DAMAGE_YES;
}
setorigin(self, self.oldorigin);
- self.think = SUB_Null;
+ self.think = func_null;
+ self.nextthink = 0;
}
/*QUAKED spawnfunc_func_door_secret (0 .5 .8) ? open_once 1st_left 1st_down no_shoot always_shoot
{
self.health = 10000;
self.takedamage = DAMAGE_YES;
- self.event_damage = fd_secret_use;
+ self.event_damage = fd_secret_damage;
}
self.oldorigin = self.origin;
if (!self.wait)
self.cnt = 360 / self.speed;
self.blocked = generic_plat_blocked;
- if(self.dmg & (!self.message))
+ if(self.dmg && (self.message == ""))
self.message = " was squished";
- if(self.dmg && (!self.message2))
+ if(self.dmg && (self.message2 == ""))
self.message2 = "was squished by";
if(self.dmg && (!self.dmgtime))
self.dmgtime = 0.25;
controller.nextthink = time + 1;
controller.think = func_fourier_controller_think;
self.nextthink = self.ltime + 999999999;
- self.think = SUB_Null;
+ self.think = SUB_NullThink; // for PushMove
// Savage: Reduce bandwith, critical on e.g. nexdm02
self.effects |= EF_LOWPRECISION;
self.target4normal = normalize(self.target4normal);
self.blocked = generic_plat_blocked;
- if(self.dmg & (!self.message))
+ if(self.dmg && (self.message == ""))
self.message = " was squished";
- if(self.dmg && (!self.message2))
+ if(self.dmg && (self.message == ""))
self.message2 = "was squished by";
if(self.dmg && (!self.dmgtime))
self.dmgtime = 0.25;
// wait for targets to spawn
self.nextthink = self.ltime + 999999999;
- self.think = SUB_Null;
+ self.think = SUB_NullThink; // for PushMove
// Savage: Reduce bandwith, critical on e.g. nexdm02
self.effects |= EF_LOWPRECISION;
// this must be called to spawn the teleport waypoints for bots
InitializeEntity(self, teleport_findtarget, INITPRIO_FINDTARGET);
- if (!self.target)
+ if (self.target == "")
{
objerror ("Teleporter with no target");
return;
self.solid = SOLID_NOT;
self.tur_head.solid = self.solid;
- self.event_damage = SUB_Null;
+ self.event_damage = func_null;
self.takedamage = DAMAGE_NO;
self.health = 0;
if (self.health <= 0)
{
- self.event_damage = SUB_Null;
- self.tur_head.event_damage = SUB_Null;
+ self.event_damage = func_null;
+ self.tur_head.event_damage = func_null;
self.takedamage = DAMAGE_NO;
self.nextthink = time;
self.think = turret_stdproc_die;
{
self.takedamage = DAMAGE_NO;
- self.event_damage = SUB_Null;
+ self.event_damage = func_null;
#ifdef TURRET_DEBUG
float d;
d = RadiusDamage (self, self.owner, self.owner.shot_dmg, 0, self.owner.shot_radius, self, self.owner.shot_force, self.totalfrags, world);
vector shortangle_vxy(vector ang1, vector ang2)
{
- vector vtmp;
+ vector vtmp = '0 0 0';
vtmp_x = shortangle_f(ang1_x,ang2_x);
vtmp_y = shortangle_f(ang1_y,ang2_y);
self.movetype = MOVETYPE_WALK;
self.effects &~= EF_NODRAW;
self.alpha = 1;
- self.PlayerPhysplug = SUB_Null;
+ self.PlayerPhysplug = func_null;
self.view_ofs = PL_VIEW_OFS;
self.event_damage = PlayerDamage;
self.hud = HUD_NORMAL;
other.solid = SOLID_NOT;
other.movetype = MOVETYPE_NOCLIP;
other.alpha = -1;
- other.event_damage = SUB_Null;
+ other.event_damage = func_null;
other.view_ofs = '0 0 0';
other.hud = _gun.hud;
other.PlayerPhysplug = _gun.PlayerPhysplug;
if(random() > 0.5)
_body.touch = bumb_blowup;
else
- _body.touch = SUB_Null;
+ _body.touch = func_null;
_body.think = bumb_diethink;
_body.nextthink = time;
pointparticles(particleeffectnum("explosion_medium"), findbetterlocation(self.origin, 16), '0 0 0', 1);
self.health = 0;
- self.event_damage = SUB_Null;
+ self.event_damage = func_null;
self.solid = SOLID_CORPSE;
self.takedamage = DAMAGE_NO;
self.deadflag = DEAD_DYING;
self.colormod = '0 0 0';
self.avelocity = '0 0 0';
self.velocity = '0 0 0';
- self.touch = SUB_Null;
+ self.touch = func_null;
self.nextthink = 0;
setorigin(self, self.pos1);
vector autocvar_g_vehicle_racer_bouncepain;
var vector racer_force_from_tag(string tag_name, float spring_length, float max_power);
-void racer_spawn(float _spawnflag);
+void racer_spawn_default();
void racer_align4point(float _delta)
{
DEATH_WAKIBLOWUP, world);
self.nextthink = time + autocvar_g_vehicle_racer_respawntime;
- self.think = racer_spawn;
+ self.think = racer_spawn_default;
self.movetype = MOVETYPE_NONE;
self.effects = EF_NODRAW;
self.velocity = '0 0 0';
setorigin(self, self.pos1);
- self.think = racer_spawn;
- self.nextthink = time + autocvar_g_vehicle_racer_respawntime;
}
void racer_deadtouch()
void racer_die()
{
self.health = 0;
- self.event_damage = SUB_Null;
+ self.event_damage = func_null;
self.solid = SOLID_CORPSE;
self.takedamage = DAMAGE_NO;
self.deadflag = DEAD_DYING;
self.damageforcescale = 0.5;
//self.destvec = autocvar_g_vehicle_racer_bouncepain;
}
+void racer_spawn_default()
+{
+ racer_spawn(0);
+}
self.velocity = '0 0 0';
setorigin(self, self.pos1);
- self.touch = SUB_Null;
+ self.touch = func_null;
self.nextthink = 0;
}
void raptor_die()
{
self.health = 0;
- self.event_damage = SUB_Null;
+ self.event_damage = func_null;
self.solid = SOLID_CORPSE;
self.takedamage = DAMAGE_NO;
self.deadflag = DEAD_DYING;
DEATH_SBROCKET, PROJECTILE_SPIDERROCKET, autocvar_g_vehicle_spiderbot_rocket_health, FALSE, TRUE, self.owner);
crosshair_trace(self.owner);
- vector _ct_end = trace_endpos + trace_plane_normal;
rocket.pos1 = trace_endpos + randomvec() * (0.75 * autocvar_g_vehicle_spiderbot_rocket_radius);
rocket.pos1_z = trace_endpos_z;
void spiderbot_die()
{
self.health = 0;
- self.event_damage = SUB_Null;
+ self.event_damage = func_null;
self.takedamage = DAMAGE_NO;
- self.touch = SUB_Null;
+ self.touch = func_null;
self.cnt = 3.4 + time + random() * 2;
self.think = spiderbot_blowup;
self.nextthink = time;
if(self.health < 1)
{
self.takedamage = DAMAGE_NO;
- self.event_damage = SUB_Null;
+ self.event_damage = func_null;
self.think = self.use;
self.nextthink = time;
}
PROJECTILE_TOUCH;
- self.event_damage = SUB_Null;
+ self.event_damage = func_null;
RadiusDamage (self, self.realowner, self.shot_dmg, 0, self.shot_radius, self, self.shot_force, self.totalfrags, other);
remove (self);
self.owner.movetype = MOVETYPE_NOCLIP;
self.owner.alpha = -1;
self.owner.vehicle = self;
- self.owner.event_damage = SUB_Null;
+ self.owner.event_damage = func_null;
self.owner.view_ofs = '0 0 0';
self.colormap = self.owner.colormap;
if(self.tur_head)
_player.movetype = MOVETYPE_WALK;
_player.effects &~= EF_NODRAW;
_player.alpha = 1;
- _player.PlayerPhysplug = SUB_Null;
+ _player.PlayerPhysplug = func_null;
_player.vehicle = world;
_player.view_ofs = PL_VIEW_OFS;
_player.event_damage = PlayerDamage;
#define VHSF_NORMAL 0
#define VHSF_FACTORY 2
var .void(float _spawnflag) vehicle_spawn; /// Vehicles custom fucntion to be efecuted when vehicle (re)spawns
-const var .float(float _imp) vehicles_impusle_null;
var .float(float _imp) vehicles_impusle;
.float vehicle_weapon2mode = volly_counter;
self.think = self.W_BallisticBullet_LeaveSolid_think_save;
self.nextthink = max(time, self.W_BallisticBullet_LeaveSolid_nextthink_save);
- self.W_BallisticBullet_LeaveSolid_think_save = SUB_Null;
+ self.W_BallisticBullet_LeaveSolid_think_save = func_null;
self.flags &~= FL_ONGROUND;
void W_PrepareExplosionByDamage(entity attacker, void() explode)
{
self.takedamage = DAMAGE_NO;
- self.event_damage = SUB_Null;
+ self.event_damage = func_null;
if((attacker.flags & FL_CLIENT) && !autocvar_g_projectiles_keep_owner)
{
if(IsFlying(other))
AnnounceTo(self.realowner, "electrobitch");
- self.event_damage = SUB_Null;
+ self.event_damage = func_null;
self.takedamage = DAMAGE_NO;
if (self.movetype == MOVETYPE_BOUNCE)
{
{
W_Plasma_TriggerCombo(self.origin, autocvar_g_balance_electro_combo_comboradius, self.realowner);
- self.event_damage = SUB_Null;
+ self.event_damage = func_null;
RadiusDamage (self, self.realowner, autocvar_g_balance_electro_combo_damage, autocvar_g_balance_electro_combo_edgedamage, autocvar_g_balance_electro_combo_radius, world, autocvar_g_balance_electro_combo_force, WEP_ELECTRO | HITTYPE_BOUNCE, world); // use THIS type for a combo because primary can't bounce
remove (self);
}
vector dir;
float d;
- self.event_damage = SUB_Null;
+ self.event_damage = func_null;
self.takedamage = DAMAGE_NO;
// 1. dist damage
if(IsFlying(other))
AnnounceTo(self.realowner, "airshot");
- self.event_damage = SUB_Null;
+ self.event_damage = func_null;
self.takedamage = DAMAGE_NO;
if(self.movetype == MOVETYPE_NONE)
if(IsFlying(other))
AnnounceTo(self.realowner, "airshot");
- self.event_damage = SUB_Null;
+ self.event_damage = func_null;
self.takedamage = DAMAGE_NO;
if(self.movetype == MOVETYPE_NONE)
void W_Hagar_Explode (void)
{
- self.event_damage = SUB_Null;
+ self.event_damage = func_null;
RadiusDamage (self, self.realowner, autocvar_g_balance_hagar_primary_damage, autocvar_g_balance_hagar_primary_edgedamage, autocvar_g_balance_hagar_primary_radius, world, autocvar_g_balance_hagar_primary_force, self.projectiledeathtype, other);
remove (self);
void W_Hagar_Explode2 (void)
{
- self.event_damage = SUB_Null;
+ self.event_damage = func_null;
RadiusDamage (self, self.realowner, autocvar_g_balance_hagar_secondary_damage, autocvar_g_balance_hagar_secondary_edgedamage, autocvar_g_balance_hagar_secondary_radius, world, autocvar_g_balance_hagar_secondary_force, self.projectiledeathtype, other);
remove (self);
else if (req == WR_THINK)
{
float loadable_secondary;
- loadable_secondary = autocvar_g_balance_hagar_secondary_load && autocvar_g_balance_hagar_secondary;
+ loadable_secondary = (autocvar_g_balance_hagar_secondary_load && autocvar_g_balance_hagar_secondary);
if (loadable_secondary)
W_Hagar_Attack2_Load(); // must always run each frame
{
PROJECTILE_TOUCH;
- self.event_damage = SUB_Null;
+ self.event_damage = func_null;
if(self.projectiledeathtype & HITTYPE_SECONDARY)
RadiusDamage (self, self.realowner, autocvar_g_balance_hlac_secondary_damage, autocvar_g_balance_hlac_secondary_edgedamage, autocvar_g_balance_hlac_secondary_radius, world, autocvar_g_balance_hlac_secondary_force, self.projectiledeathtype, other);
void W_Hook_Explode2 (void)
{
- self.event_damage = SUB_Null;
- self.touch = SUB_Null;
+ self.event_damage = func_null;
+ self.touch = func_null;
self.effects |= EF_NODRAW;
self.think = W_Hook_ExplodeThink;
{
PROJECTILE_TOUCH;
- self.event_damage = SUB_Null;
+ self.event_damage = func_null;
if (self.dmg)
RadiusDamage (self, self.realowner, autocvar_g_balance_laser_secondary_damage, autocvar_g_balance_laser_secondary_edgedamage, autocvar_g_balance_laser_secondary_radius, world, autocvar_g_balance_laser_secondary_force, self.projectiledeathtype, other);
else
newmine.mine_time = self.mine_time;
- newmine.touch = SUB_Null;
+ newmine.touch = func_null;
newmine.think = W_Mine_Think;
newmine.nextthink = time;
newmine.cnt = self.cnt;
if(IsFlying(other))
AnnounceTo(self.realowner, "airshot");
- self.event_damage = SUB_Null;
+ self.event_damage = func_null;
self.takedamage = DAMAGE_NO;
RadiusDamage (self, self.realowner, autocvar_g_balance_minelayer_damage, autocvar_g_balance_minelayer_edgedamage, autocvar_g_balance_minelayer_radius, world, autocvar_g_balance_minelayer_force, self.projectiledeathtype, other);
void W_Mine_DoRemoteExplode ()
{
- self.event_damage = SUB_Null;
+ self.event_damage = func_null;
self.takedamage = DAMAGE_NO;
if(self.movetype == MOVETYPE_NONE || self.movetype == MOVETYPE_FOLLOW)
if(IsFlying(other))
AnnounceTo(self.realowner, "airshot");
- self.event_damage = SUB_Null;
+ self.event_damage = func_null;
self.takedamage = DAMAGE_NO;
RadiusDamage (self, self.realowner, autocvar_g_balance_rocketlauncher_damage, autocvar_g_balance_rocketlauncher_edgedamage, autocvar_g_balance_rocketlauncher_radius, world, autocvar_g_balance_rocketlauncher_force, self.projectiledeathtype, other);
{
W_Rocket_Unregister();
- self.event_damage = SUB_Null;
+ self.event_damage = func_null;
self.takedamage = DAMAGE_NO;
RadiusDamage (self, self.realowner, autocvar_g_balance_rocketlauncher_remote_damage, autocvar_g_balance_rocketlauncher_remote_edgedamage, autocvar_g_balance_rocketlauncher_remote_radius, world, autocvar_g_balance_rocketlauncher_remote_force, self.projectiledeathtype | HITTYPE_BOUNCE, world);
// ============================
void Seeker_Missile_Explode ()
{
- self.event_damage = SUB_Null;
+ self.event_damage = func_null;
RadiusDamage (self, self.realowner, autocvar_g_balance_seeker_missile_damage, autocvar_g_balance_seeker_missile_edgedamage, autocvar_g_balance_seeker_missile_radius, world, autocvar_g_balance_seeker_missile_force, self.projectiledeathtype, other);
remove (self);
// ============================
void Seeker_Flac_Explode ()
{
- self.event_damage = SUB_Null;
+ self.event_damage = func_null;
RadiusDamage (self, self.realowner, autocvar_g_balance_seeker_flac_damage, autocvar_g_balance_seeker_flac_edgedamage, autocvar_g_balance_seeker_flac_radius, world, autocvar_g_balance_seeker_flac_force, self.projectiledeathtype, other);
te_knightspike(org2);
- self.event_damage = SUB_Null;
+ self.event_damage = func_null;
Damage_DamageInfo(self.origin, 0, 0, 0, self.velocity, WEP_SEEKER | HITTYPE_HEADSHOT, other.species, self);
if (other.takedamage == DAMAGE_AIM && other.deadflag == DEAD_NO)
missile.solid = SOLID_BBOX;
missile.takedamage = DAMAGE_YES;
- missile.event_damage = Seeker_Tag_Explode;
- missile.health = autocvar_g_balance_seeker_tag_health;
+ missile.event_damage = Seeker_Tag_Damage;
+ missile.health = autocvar_g_balance_seeker_tag_health;
missile.damageforcescale = autocvar_g_balance_seeker_tag_damageforcescale;
setorigin (missile, w_shotorg);
#define MOVE_NOTHING -1
entity WarpZone_trace_forent; // temp, callback is allowed to change it
typedef void(vector start, vector hit, vector end) WarpZone_trace_callback_t; // called on every elementary trace
-const var WarpZone_trace_callback_t WarpZone_trace_callback_t_null;
+var WarpZone_trace_callback_t WarpZone_trace_callback_t_null;
entity WarpZone_trace_transform; // transform accumulator during a trace
entity WarpZone_trace_firstzone; // first warpzone hit by a trace (can differ from the requested zone in case of _ThroughZone, the trace is aborted then)
entity WarpZone_trace_lastzone; // first warpzone hit by a trace (can differ from the requested zone in case of _ThroughZone, the trace is aborted then)