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 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
-Werror -Wall \
-Wno-field-redeclared \
-Wno-double-declaration \
- -Wno-assign-function-types \
- -Wno-unused-variable \
+ -Wno-uninitialized-global \
-O3 \
+ -fadjust-vector-fields \
-fftepp \
+ -fftepp-predefs \
+ -frelaxed-switch \
+ -fshort-logic \
+ -fno-perl-logic \
-ftranslatable-strings \
- -fadjust-vector-fields \
- -fassign-function-types \
+ -fno-initialized-nonconstants \
+ -fno-assign-function-types \
+ -flno \
-fcorrect-ternary \
+ -fno-single-vector-defs \
-fcorrect-logic \
-ftrue-empty-strings \
- -fshort-logic \
- -flno \
+ -fno-false-empty-strings \
+ -futf8 \
+ -fno-bail-on-werror \
+ -floop-labels \
+ -funtyped-nil \
+ -fno-permissive \
$(QCCFLAGS_EXTRA) $(QCCFLAGS_WATERMARK)
else
# this. is. fteqccccccccccccccccccc!
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;
if(self.entremove)
self.entremove();
+ if(self.skeletonindex)
+ {
+ skel_delete(self.skeletonindex);
+ 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;
// improved polyblend
- vector rgb;
if(autocvar_hud_contents)
{
float contentalpha_temp, incontent, liquidalpha, contentfadetime;
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_precacheplayermodels;
float autocvar_cl_deathglow;
float autocvar_developer_csqcentities;
+float autocvar_g_jetpack_attenuation;
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
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 = 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;
float barsize_x = 0, barsize_y = 0, baroffset_x = 0, baroffset_y = 0;
{
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])
{
{
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
// 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)
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:
-const string string_null;
-
// --------------------------------------------------------------------------
// MENU Functionality
-var float(string text, float handleColors, vector fontSize) stringwidth;
-
entity players;
entity teams;
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);
#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()
{
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);
#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
../../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
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");
{
// layout: Ping, Map name, Map name, NP, TP, MP
string s;
- float p;
float theAlpha;
float included;
{
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);
}
}
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;
}
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();
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(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)
{
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;
// Declarations
string s, a, msg;
- float w, type;
+ float type;
string s1 = NO_STR_ARG, s2 = NO_STR_ARG;
float f1 = NO_FL_ARG, f2 = NO_FL_ARG, f3 = NO_FL_ARG;
if(autocvar_g_campaign)
CampaignPreIntermission();
+ MUTATOR_CALLHOOK(MatchEnd);
+
localcmd("\nsv_hook_gameend\n");
}
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
{
{
e.customizeentityforclient = customizer;
e.uncustomizeentityforclient = uncustomizer;
- e.uncustomizeentityforclient_set = (uncustomizer != func_null);
+ 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)
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;
}
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;
}
#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);
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);
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.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)
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()
self.damageforcescale = 0.5;
//self.destvec = autocvar_g_vehicle_racer_bouncepain;
}
+void racer_spawn_default()
+{
+ racer_spawn(0);
+}
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;
#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;
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
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)