]> de.git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
Merge branch 'master' into divVerent/csad
authorRudolf Polzer <divverent@xonotic.org>
Wed, 23 Jan 2013 10:32:27 +0000 (11:32 +0100)
committerRudolf Polzer <divverent@xonotic.org>
Wed, 23 Jan 2013 10:32:27 +0000 (11:32 +0100)
Conflicts:
qcsrc/client/Main.qc
qcsrc/client/autocvars.qh

126 files changed:
_hud_descriptions.cfg
commands.cfg
defaultXonotic.cfg
hud_luminos.cfg
hud_luminos_minimal.cfg
hud_luminos_minimal_xhair.cfg
hud_luminos_old.cfg
hud_nexuiz.cfg
qcsrc/Makefile
qcsrc/client/Main.qc
qcsrc/client/View.qc
qcsrc/client/announcer.qc
qcsrc/client/autocvars.qh
qcsrc/client/casings.qc
qcsrc/client/csqcmodel_hooks.qc
qcsrc/client/damage.qc
qcsrc/client/effects.qc
qcsrc/client/gibs.qc
qcsrc/client/hud.qc
qcsrc/client/hud_config.qc
qcsrc/client/laser.qc
qcsrc/client/main.qh
qcsrc/client/mapvoting.qc
qcsrc/client/miscfunctions.qc
qcsrc/client/modeleffects.qc
qcsrc/client/particles.qc
qcsrc/client/projectile.qc
qcsrc/client/scoreboard.qc
qcsrc/client/shownames.qc
qcsrc/client/teamradar.qc
qcsrc/client/tturrets.qc
qcsrc/client/vehicles/vehicles.qc
qcsrc/client/wall.qc
qcsrc/client/waypointsprites.qc
qcsrc/common/command/generic.qc
qcsrc/common/mapinfo.qc
qcsrc/common/net_notice.qc
qcsrc/common/util-pre.qh
qcsrc/common/util.qc
qcsrc/common/util.qh
qcsrc/csqcmodellib/cl_model.qc
qcsrc/csqcmodellib/interpolate.qc
qcsrc/menu/classes.c
qcsrc/menu/command/menu_cmd.qc
qcsrc/menu/item/button.c
qcsrc/menu/item/gecko.c [deleted file]
qcsrc/menu/item/listbox.c
qcsrc/menu/menu.qc
qcsrc/menu/menu.qh
qcsrc/menu/progs.src
qcsrc/menu/sys-post.qh [new file with mode: 0644]
qcsrc/menu/sys-pre.qh [new file with mode: 0644]
qcsrc/menu/xonotic/colorpicker.c
qcsrc/menu/xonotic/dialog_hudpanel_weapons.c
qcsrc/menu/xonotic/dialog_news.c [deleted file]
qcsrc/menu/xonotic/inputbox.c
qcsrc/menu/xonotic/maplist.c
qcsrc/menu/xonotic/serverlist.c
qcsrc/menu/xonotic/util.qc
qcsrc/server/attic/monsters/m_monsters.qc
qcsrc/server/attic/monsters/monster_zombie.qc
qcsrc/server/attic/nexball.qc
qcsrc/server/attic/vehicles/bumblebee.qc
qcsrc/server/autocvars.qh
qcsrc/server/bot/bot.qc
qcsrc/server/bot/waypoints.qc
qcsrc/server/cl_client.qc
qcsrc/server/cl_player.qc
qcsrc/server/cl_weaponsystem.qc
qcsrc/server/command/common.qc
qcsrc/server/command/sv_cmd.qc
qcsrc/server/command/vote.qc
qcsrc/server/defs.qh
qcsrc/server/domination.qc
qcsrc/server/func_breakable.qc
qcsrc/server/g_damage.qc
qcsrc/server/g_hook.qc
qcsrc/server/g_lights.qc
qcsrc/server/g_subs.qc
qcsrc/server/g_triggers.qc
qcsrc/server/g_world.qc
qcsrc/server/ipban.qc
qcsrc/server/item_key.qc
qcsrc/server/miscfunctions.qc
qcsrc/server/mutators/base.qc
qcsrc/server/mutators/gamemode_ctf.qc
qcsrc/server/mutators/gamemode_keepaway.qc
qcsrc/server/mutators/gamemode_nexball.qc
qcsrc/server/mutators/gamemode_onslaught.qc
qcsrc/server/pathlib.qc
qcsrc/server/pathlib/movenode.qc
qcsrc/server/pathlib/pathlib.qh
qcsrc/server/playerstats.qc
qcsrc/server/playerstats.qh
qcsrc/server/portals.qc
qcsrc/server/race.qc
qcsrc/server/runematch.qc
qcsrc/server/scores.qc
qcsrc/server/scores.qh
qcsrc/server/secret.qc
qcsrc/server/sv_main.qc
qcsrc/server/t_items.qc
qcsrc/server/t_jumppads.qc
qcsrc/server/t_plats.qc
qcsrc/server/t_teleporters.qc
qcsrc/server/tturrets/system/system_damage.qc
qcsrc/server/tturrets/system/system_main.qc
qcsrc/server/tturrets/system/system_misc.qc
qcsrc/server/vehicles/bumblebee.qc
qcsrc/server/vehicles/racer.qc
qcsrc/server/vehicles/raptor.qc
qcsrc/server/vehicles/spiderbot.qc
qcsrc/server/vehicles/vehicles.qc
qcsrc/server/vehicles/vehicles_def.qh
qcsrc/server/w_common.qc
qcsrc/server/w_electro.qc
qcsrc/server/w_fireball.qc
qcsrc/server/w_grenadelauncher.qc
qcsrc/server/w_hagar.qc
qcsrc/server/w_hlac.qc
qcsrc/server/w_hook.qc
qcsrc/server/w_laser.qc
qcsrc/server/w_minelayer.qc
qcsrc/server/w_rocketlauncher.qc
qcsrc/server/w_seeker.qc
qcsrc/warpzonelib/common.qh

index cb95f968132ba7145549310b491ec98885459a7a..4c832ef1e9b9a6208be14c874f302a93528ff300 100644 (file)
@@ -52,7 +52,11 @@ seta hud_panel_weapons_complainbubble_color_unavailable "" "color of the complai
 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"
index ab737d33e39bcd6d119a989154fd39d7854b011b..44fa671bd7f88e4ace9f1c4be2cf0e3929ad1542 100644 (file)
@@ -288,7 +288,7 @@ set sv_vote_command_restriction_movetopink "1;"
 // =================================
 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"
@@ -302,6 +302,7 @@ set sv_vote_wait 120        "a player can not call a vote again for this many seconds w
 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
 
index dc5a8d6e53a3203150b57687393b33858cb018c9..6e856e986bf9d93e77a109aa5903c5055bedeaf0 100644 (file)
@@ -481,7 +481,7 @@ seta g_teamdamage_resetspeed 20     "for teamplay 4: how fast player's teamdamage co
 
 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)"
 
index 6472a257963fad8c9526546031d3d6e7c716779f..c70e1b103a79bfe75504c9c8a86c4696b28f0387 100644 (file)
@@ -52,8 +52,12 @@ seta hud_panel_weapons_ammo "1"
 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
index bb7e0662e32e3bcbce1060385a3f0d42a6961549..4c0a7f46d06ad9159dce70b715d982dfd8abb5b1 100644 (file)
@@ -54,6 +54,10 @@ seta hud_panel_weapons_ammo_alpha "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
index e0921ad35337d272f8e0c91a0032864349981cac..56ec31c8091c5566957fcb7f2112cd9f8ef7a398 100644 (file)
@@ -54,6 +54,10 @@ seta hud_panel_weapons_ammo_alpha "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
index 119f7b18f6f8cd3f163e7e6ac172db53ed4516ad..263412734311e3e73c1015f5b90596674257da7c 100644 (file)
@@ -54,6 +54,10 @@ seta hud_panel_weapons_ammo_alpha "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
index 3cf0feb753e5e08b748ce408a03f42affc78393d..42a0571bb3d96f3d92e7c87ff965f60ff982177c 100644 (file)
@@ -54,6 +54,10 @@ seta hud_panel_weapons_ammo_alpha "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
index db69248e9f4496c2e6989f9a1cfaa5d23ab39967..9fa80f8f884b8f215c249e0e9ce64a1d0f4a7a80 100644 (file)
@@ -3,11 +3,37 @@ PERL ?= perl
 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)
index 663368c78a50beeee744c95838a113db370f552a..b75fc166e585359c982d319e8bf1de0c168e60d7 100644 (file)
@@ -102,7 +102,7 @@ void CSQC_Init(void)
        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;
@@ -120,7 +120,7 @@ void CSQC_Init(void)
        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") == "")
@@ -179,6 +179,7 @@ void CSQC_Init(void)
        turrets_precache();
     Announcer_Precache();
        Tuba_Precache();
+       CSQCPlayer_Precache();
        
        if(autocvar_cl_reticle)
        {
@@ -398,7 +399,7 @@ float CSQC_InputEvent(float bInputType, float nPrimary, float nSecondary)
        if (MapVote_InputEvent(bInputType, nPrimary, nSecondary))
                return true;
 
-       if(menu_visible)
+       if(menu_visible && menu_action)
                if(menu_action(bInputType, nPrimary, nSecondary))
                        return TRUE;
 
@@ -429,6 +430,7 @@ void Ent_ReadEntCS()
                self.origin_x = ReadShort();
                self.origin_y = ReadShort();
                self.origin_z = ReadShort();
+               setorigin(self, self.origin);
        }
        if(sf & 4)
        {
@@ -798,6 +800,12 @@ void Ent_Remove()
                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;
@@ -1227,13 +1235,13 @@ float CSQC_Parse_TempEntity()
 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)
@@ -1251,10 +1259,12 @@ string getcommandkey(string text, string command)
                        }
 
                }
+               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
index 9ffe5a738c67634732ac4716a6fc8e7ccace8106..940f810573f3283f007b310855df39813e939c8f 100644 (file)
@@ -57,9 +57,11 @@ void Porto_Draw()
                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)
@@ -419,8 +421,8 @@ void CSQC_UpdateView(float w, float h)
        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();
 
@@ -780,7 +782,6 @@ void CSQC_UpdateView(float w, float h)
 
 
        // improved polyblend
-       vector rgb;
        if(autocvar_hud_contents)
        {
                float contentalpha_temp, incontent, liquidalpha, contentfadetime;
@@ -962,7 +963,7 @@ void CSQC_UpdateView(float w, float h)
                }
 
                // 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); }
                
@@ -1083,8 +1084,8 @@ void CSQC_UpdateView(float w, float h)
                        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) {
@@ -1272,9 +1273,9 @@ void CSQC_UpdateView(float w, float h)
                                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;
 
index db1ae41336d5e1eb54d30c437975b7323b330739..ec4cc78f6a06da63fa26b78cc92a2d414d1575b2 100644 (file)
@@ -81,7 +81,7 @@ void Announcer_Time()
 {
        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)
index 3029dbe819a9b708f143379b78597f5c2e70bd4d..0c926d43c9af408177f91e587eb949666ca8af93 100644 (file)
@@ -315,11 +315,14 @@ string autocvar_hud_panel_weapons_complainbubble_color_unavailable;
 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;
@@ -405,3 +408,4 @@ float autocvar_cl_precacheplayermodels;
 float autocvar_cl_deathglow;
 float autocvar_developer_csqcentities;
 float autocvar__animblend;
+float autocvar_g_jetpack_attenuation;
index a43d1726fcdce42a09aa30356391dc25cca57ac1..70ed9f4b07d74b597a39d67968bf99bdba7cd807 100644 (file)
@@ -84,6 +84,7 @@ void Ent_Casing(float isNew)
        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;
index 12defdfd74ba6abd31abe6fd63662042b292a608..23facf87f7fcc787348a1d43a406ef8089a5afbb 100644 (file)
@@ -455,6 +455,7 @@ void CSQCModel_Effects_PostUpdate(void)
        if(self.csqcmodel_teleported)
                Projectile_ResetTrail(self.origin);
 }
+.float snd_looping;
 void CSQCModel_Effects_Apply(void)
 {
        float eff = self.csqcmodel_effects;
@@ -526,6 +527,28 @@ void CSQCModel_Effects_Apply(void)
        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
index ae83d45eea011d890b8b3fd0430866d2b17312ca..cc89b03d79d290420202ccdc083209617ddb0100 100644 (file)
@@ -39,7 +39,7 @@ void DamageEffect(vector hitorg, float dmg, float type, float specnum)
 {
        // 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;
 
@@ -61,7 +61,7 @@ void DamageEffect(vector hitorg, float dmg, float type, float specnum)
                        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
@@ -113,7 +113,7 @@ void DamageEffect(vector hitorg, float dmg, float type, float specnum)
 
 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;
 
index b695867ca361995522005d50a69a99ab482ec66a..8c237aade92621df131a49b4ef079a10760e1326 100644 (file)
@@ -85,11 +85,11 @@ void Net_ReadLightningarc()
     {
         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);
     }
index 22825bc4f38d4912b70c51922098c20213308581..9e1c6e7a1395faf93d89ca7234aad0d031bdbbf2 100644 (file)
@@ -138,7 +138,8 @@ void TossGib (string mdlname, vector safeorg, vector org, vector vconst, vector
                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;
@@ -156,7 +157,7 @@ void Ent_GibSplash(float isNew)
        vector org, vel;
        string specstr;
        float issilent;
-       string gentle_prefix;
+       string gentle_prefix = "morphed_";
 
        float c, randomvalue;
 
@@ -177,8 +178,6 @@ void Ent_GibSplash(float isNew)
                        gentle_prefix = "";
                else if(cl_gentle_gibs == 3) 
                        gentle_prefix = "happy_";
-               else
-                       gentle_prefix = "morphed_";
        }
        else if(autocvar_cl_particlegibs)
        {
@@ -195,7 +194,7 @@ void Ent_GibSplash(float isNew)
        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);
index 13f37b70eb9b594cc8c68dcfde1f42936385ea41..cc870794b10653a3dea145058a83693ab5282e3b 100644 (file)
@@ -213,7 +213,10 @@ string MakeRaceString(float cp, float mytime, float histime, float lapdelta, str
                col = "^3";
        }
        else
+       {
                col = "^7";
+               timestr = "";
+       }
 
        if(cp == 254)
                cpname = _("Start line");
@@ -436,25 +439,27 @@ void HUD_Weapons(void)
        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; }
@@ -463,7 +468,7 @@ void HUD_Weapons(void)
        {
                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;
@@ -478,15 +483,6 @@ void HUD_Weapons(void)
 
        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])
        {
@@ -531,6 +527,7 @@ void HUD_Weapons(void)
                }
 
                // 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;
@@ -566,12 +563,21 @@ void HUD_Weapons(void)
        {
                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
@@ -597,12 +603,21 @@ void HUD_Weapons(void)
                }
                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
@@ -670,6 +685,7 @@ void HUD_Weapons(void)
                                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
@@ -694,7 +710,7 @@ void HUD_Weapons(void)
 
                // 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)
@@ -720,7 +736,7 @@ void HUD_Weapons(void)
                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)
@@ -926,7 +942,7 @@ void HUD_Ammo(void)
                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;
@@ -941,7 +957,7 @@ void HUD_Ammo(void)
                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)
        {
@@ -986,6 +1002,7 @@ void HUD_Ammo(void)
                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);
@@ -1003,7 +1020,7 @@ void HUD_Ammo(void)
 
 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)
@@ -1135,7 +1152,7 @@ void HUD_Powerups(void)
 
        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;
 
@@ -1228,7 +1245,7 @@ void HUD_Powerups(void)
                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;
@@ -1425,7 +1442,7 @@ void HUD_HealthArmor(void)
        {
                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;
@@ -2661,7 +2678,7 @@ void HUD_UpdatePlayerTeams();
 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);
@@ -2674,13 +2691,11 @@ void HUD_Score_Rankings(vector pos, vector mySize, entity me, float team_count)
        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
@@ -2704,7 +2719,7 @@ void HUD_Score_Rankings(vector pos, vector mySize, entity me, float team_count)
                        {
                                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
@@ -2804,7 +2819,7 @@ void HUD_Score(void)
                mySize -= '2 2 0' * panel_bg_padding;
        }
 
-       float score, distribution;
+       float score, distribution = 0;
        string sign;
        vector distribution_color;
        entity tm, pl, me;
@@ -2894,8 +2909,8 @@ void HUD_Score(void)
                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)
                {
@@ -2936,6 +2951,7 @@ void HUD_Score(void)
                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;
@@ -3004,7 +3020,7 @@ void HUD_RaceTimer (void)
        }
 
        // always force 4:1 aspect
-       vector newSize;
+       vector newSize = '0 0 0';
        if(mySize_x/mySize_y > 4)
        {
                newSize_x = 4 * mySize_y;
@@ -3096,13 +3112,13 @@ void HUD_RaceTimer (void)
                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);
                }
 
@@ -3215,7 +3231,7 @@ void HUD_VoteWindow(void)
        }
 
        // always force 3:1 aspect
-       vector newSize;
+       vector newSize = '0 0 0';
        if(mySize_x/mySize_y > 3)
        {
                newSize_x = 3 * mySize_y;
@@ -3475,7 +3491,7 @@ void HUD_Mod_KH(vector pos, vector mySize)
        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);
 
@@ -3792,6 +3808,8 @@ void HUD_Mod_Race(vector pos, vector mySize)
        float rank;
        if(race_status > 0)
                rank = race_CheckName(race_status_name);
+       else
+               rank = 0;
        string rankname;
        rankname = race_PlaceName(rank);
 
@@ -3836,6 +3854,11 @@ void DrawDomItem(vector myPos, vector mySize, float aspect_ratio, float layout,
        float stat, pps_ratio;
        string pic;
        vector color;
+#ifdef GMQCC
+       stat = -1;
+       pic = "";
+       color = '0 0 0';
+#endif
        switch(i)
        {
                case 0:
@@ -3853,10 +3876,12 @@ void DrawDomItem(vector myPos, vector mySize, float aspect_ratio, float layout,
                        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);
 
@@ -3897,7 +3922,7 @@ void HUD_Mod_Dom(vector myPos, vector mySize)
 {
        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;
@@ -3910,7 +3935,7 @@ void HUD_Mod_Dom(vector myPos, vector mySize)
        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;
@@ -4019,7 +4044,7 @@ void HUD_DrawPressedKeys(void)
        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;
@@ -4229,7 +4254,7 @@ void HUD_InfoMessages(void)
        }
 
        // always force 5:1 aspect
-       vector newSize;
+       vector newSize = '0 0 0';
        if(mySize_x/mySize_y > 5)
        {
                newSize_x = 5 * mySize_y;
@@ -4352,7 +4377,7 @@ void HUD_InfoMessages(void)
 
                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)
                        {
@@ -4418,7 +4443,7 @@ void HUD_Physics(void)
                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;
 
@@ -4491,7 +4516,7 @@ void HUD_Physics(void)
 
        //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;
@@ -4533,7 +4558,7 @@ void HUD_Physics(void)
                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;
@@ -4592,12 +4617,12 @@ void HUD_Physics(void)
                        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)
@@ -4843,7 +4868,7 @@ void HUD_CenterPrint (void)
        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;
 
@@ -4875,6 +4900,8 @@ void HUD_CenterPrint (void)
                        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); 
@@ -5129,8 +5156,8 @@ void HUD_Main (void)
        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;
index 75c1d2c0e4328b362ca38598fc4c4788c323bfa7..acff2892da506f53bdef49d0bb8f77baa73735ea 100644 (file)
@@ -80,6 +80,10 @@ void HUD_Panel_ExportCfg(string cfgname)
                                        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:
@@ -658,7 +662,7 @@ float HUD_Panel_InputEvent(float bInputType, float nPrimary, float nSecondary)
        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)))
@@ -750,8 +754,8 @@ float HUD_Panel_InputEvent(float bInputType, float nPrimary, float nSecondary)
                }
                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
@@ -902,7 +906,7 @@ float HUD_Panel_InputEvent(float bInputType, float nPrimary, float nSecondary)
 
 float HUD_Panel_Check_Mouse_Pos(float allow_move)
 {
-       float i, j, border;
+       float i, j = 0, border;
 
        while(j < HUD_PANEL_NUM)
        {
@@ -969,7 +973,7 @@ void HUD_Panel_FirstInDrawQ(float id)
        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]), " ");
@@ -982,7 +986,7 @@ void HUD_Panel_FirstInDrawQ(float id)
 
 void HUD_Panel_Highlight(float allow_move)
 {
-       float i, j, border;
+       float i, j = 0, border;
 
        while(j < HUD_PANEL_NUM)
        {
@@ -1142,7 +1146,7 @@ void HUD_Panel_Mouse()
                        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);
index a91e13b01991e52517af210079478858eb0faae7..c5475d7a63a3cb738f1cb387930169794f233a6f 100644 (file)
@@ -85,6 +85,7 @@ void Ent_Laser()
                self.origin_x = ReadCoord();
                self.origin_y = ReadCoord();
                self.origin_z = ReadCoord();
+               setorigin(self, self.origin);
        }
        if(f & 8)
        {
index 43e7b64995e3b991f05b72f0623f684fa2892acd..28536c256b017f5f7a0397e86728c90fe0d4682f 100644 (file)
@@ -1,5 +1,3 @@
-const string string_null;
-
 // --------------------------------------------------------------------------
 // MENU Functionality
 
index 7aad4c4ffdd77b543bee03f612b6fe67e85a02f2..192817bbc149b4ed26e25fb0c39782cb8ee4fb14 100644 (file)
@@ -28,6 +28,8 @@ string MapVote_FormatMapItem(float id, string map, float count, float maxwidth,
                        post = _(" (1 vote)");
                else if(count >= 0)
                        post = sprintf(_(" (%d votes)"), count);
+               else
+                       post = "";
        }
        else
                post = "";
@@ -50,7 +52,7 @@ vector MapVote_RGB(float id, float count)
 
 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;
@@ -169,7 +171,7 @@ void MapVote_Draw()
        float center;
        float columns, rows;
        float tsize;
-       vector dist;
+       vector dist = '0 0 0';
 
        if(!mv_active)
                return;
index 72bb9c5c40a66ec0932bc1dbed0d3b2d00e8a292..6cceb42bacda13964394e996318c8f37f0e8fb3f 100644 (file)
@@ -1,5 +1,3 @@
-var float(string text, float handleColors, vector fontSize) stringwidth;
-
 entity players;
 entity teams;
 
@@ -149,7 +147,7 @@ float PreviewExists(string name)
 
 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);
@@ -231,7 +229,7 @@ vector expandingbox_resize_centered_box_offset(float sz, vector boxsize, float b
 
 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;
@@ -250,7 +248,7 @@ void drawborderlines(float thickness, vector pos, vector dim, vector color, floa
 
 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;
index 1b546534919412bfb7f92bb48ac6d71ed00014d6..0508a8669a984ab102530a5403c1e59a7aa20667 100644 (file)
@@ -6,7 +6,7 @@
 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)
@@ -41,6 +41,7 @@ void Ent_ModelEffect(float isNew)
        e.origin_x = ReadCoord();
        e.origin_y = ReadCoord();
        e.origin_z = ReadCoord();
+       setorigin(e, e.origin);
        if(f & 1)
        {
                e.velocity_x = ReadCoord();
index 6e24893b02e005b08d9b3e142dad4d70e6c1efd7..3e2222f4aae07fc017cde94d3895caa779919bc3 100644 (file)
@@ -57,7 +57,7 @@ void Draw_PointParticles()
                        }
                        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;
@@ -68,7 +68,7 @@ void Draw_PointParticles()
                        --i;
                }
        }
-       self.origin = o;
+       setorigin(self, o);
 }
 
 void Ent_PointParticles_Remove()
index 4081bd8d1800c147a4867d2a6b6321bb11ed5e39..25032806eb9df5029a3066f69eb5b4aacf643cde 100644 (file)
@@ -4,10 +4,6 @@
 .float trail_oldtime;
 .float fade_time, fade_rate;
 
-void SUB_Null()
-{
-}
-
 void SUB_Stop()
 {
        self.move_velocity = self.move_avelocity = '0 0 0';
@@ -164,14 +160,11 @@ void loopsound(entity e, float ch, string samp, float vol, float attn)
                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);
@@ -229,6 +222,7 @@ void Ent_Projectile()
                self.origin_x = ReadCoord();
                self.origin_y = ReadCoord();
                self.origin_z = ReadCoord();
+               setorigin(self, self.origin);
                if(self.count & 0x80)
                {
                        self.velocity_x = ReadCoord();
@@ -327,7 +321,7 @@ void Ent_Projectile()
                                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;
@@ -344,7 +338,7 @@ void Ent_Projectile()
                                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;
@@ -356,21 +350,21 @@ void Ent_Projectile()
                                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);
@@ -380,7 +374,7 @@ void Ent_Projectile()
                        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;
@@ -420,7 +414,7 @@ void Ent_Projectile()
                                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;
@@ -428,6 +422,7 @@ void Ent_Projectile()
                        default:
                                break;
                }
+               setsize(self, self.mins, self.maxs);
        }
 
        if(self.gravity)
index 303be36205e39c8b9eaa23815eb5bf84aa440649..af982ad46547bd4d2435e56f40e7e929b6d38723 100644 (file)
@@ -129,9 +129,25 @@ void HUD_UpdatePlayerTeams()
        */
 }
 
+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);
 
@@ -154,33 +170,23 @@ float HUD_ComparePlayerScores(entity left, entity right)
                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;
 }
@@ -199,26 +205,30 @@ void HUD_UpdatePlayerPos(entity player)
 
 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;
 }
@@ -306,7 +316,7 @@ void Cmd_HUD_SetFields(float argc)
 {
        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?
@@ -791,7 +801,7 @@ void HUD_PrintScoreboardItem(vector pos, entity pl, float is_self, float pl_numb
 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
@@ -955,7 +965,7 @@ vector HUD_DrawScoreboardAccuracyStats(vector pos, vector rgb, vector bg_size)
 
        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;
 
@@ -1092,7 +1102,7 @@ vector HUD_DrawMapStats(vector pos, vector rgb, vector bg_size) {
        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;
 
@@ -1133,7 +1143,7 @@ vector HUD_DrawScoreboardRankings(vector pos, entity pl,  vector rgb, vector bg_
        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;
 
@@ -1258,9 +1268,19 @@ void HUD_DrawScoreboard()
 
                        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;
@@ -1283,7 +1303,7 @@ void HUD_DrawScoreboard()
                        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)
index 5309c555e6085050b6a37b36509cf010964c2deb..8b4f7a09f6996bbc22c5dcad8e9403e80908fe2e 100644 (file)
@@ -43,7 +43,7 @@ void Draw_ShowNames(entity ent)
                }
 
                // handle tag fading
-               float overlap, onscreen, crosshairdistance;
+               float overlap = FALSE, onscreen, crosshairdistance;
                vector o, eo;
                
                o = project_3d_to_2d(ent.origin);
@@ -215,7 +215,7 @@ void Draw_ShowNames_All()
                        e.sameteam = 0;
                }
 
-               e.origin = getplayerorigin(i);
+               setorigin(e, getplayerorigin(i));
                if(e.origin == GETPLAYERORIGIN_ERROR)
                        continue;
                        
index f3ec99bfeebb526424a95dd5bf21cc7e84433b8f..e5dcc00f2c911ffe2d650ed83007d309aa0f6f22 100644 (file)
@@ -211,6 +211,7 @@ void Ent_RadarLink()
                self.origin_x = ReadCoord();
                self.origin_y = ReadCoord();
                self.origin_z = ReadCoord();
+               setorigin(self, self.origin);
        }
 
        if(sendflags & 2)
index 272a24610204128247559cf76ecd6fca41bef53b..6f3b030502196171db72a24520b89fb7a9713979 100644 (file)
@@ -542,7 +542,8 @@ entity turret_gibtoss(string _model, vector _from, vector _to, vector _cmod, flo
     
     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;
@@ -605,6 +606,7 @@ void ent_turret()
            self.origin_x = ReadCoord();
            self.origin_y = ReadCoord();
            self.origin_z = ReadCoord();
+           setorigin(self, self.origin);
            
            self.angles_x = ReadAngle();
            self.angles_y = ReadAngle();
index 3a4597ab2e4be241d5b16d7dc8ec35a8f788dd38..a6dbcef10305d55c3c7ca9f299067d0f3a8ba4ee 100644 (file)
@@ -41,7 +41,6 @@ void CSQC_BUMBLE_GUN_HUD();
 
 #define MAX_AXH 4
 entity AuxiliaryXhair[MAX_AXH];
-const var void Draw_Not();
 
 .string axh_image;
 .float  axh_fadetime;
@@ -84,7 +83,7 @@ void AuxiliaryXhair_Draw2D()
     }
 
     if(time - self.cnt > self.axh_fadetime)
-        self.draw2d = Draw_Not;
+        self.draw2d = func_null;
 }
 
 void Net_AuXair2(float bIsNew)
@@ -95,7 +94,7 @@ 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;
@@ -148,7 +147,7 @@ void Net_VehicleSetup()
             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;
@@ -212,13 +211,13 @@ void Net_VehicleSetup()
     }
 }
 #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()
 {
@@ -231,7 +230,7 @@ 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
@@ -327,7 +326,7 @@ 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);
@@ -349,7 +348,7 @@ void CSQC_BUMBLE_HUD()
     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);
@@ -382,7 +381,7 @@ void CSQC_BUMBLE_GUN_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
@@ -503,7 +502,7 @@ void CSQC_SPIDER_HUD()
        if(autocvar_r_letterbox)
         return;
 
-    vector picsize, hudloc, pic2size, picloc;
+    vector picsize, hudloc = '0 0 0', pic2size, picloc;
     float i;
 
     // Fetch health & ammo stats
@@ -666,7 +665,7 @@ void CSQC_RAPTOR_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
@@ -860,7 +859,7 @@ void CSQC_WAKIZASHI_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
index 807b260ab2131eb57627aa564505898fdf9a50da..3d5aa138ffb07f0689dd544db9919f1a9e092301 100644 (file)
@@ -10,9 +10,10 @@ void Ent_Wall_Draw()
        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)
        {
@@ -41,10 +42,7 @@ void Ent_Wall_Draw()
 
        InterpolateOrigin_Do();
 
-       if(self.bgmscriptangular)
-               self.saved = self.angles;
-       else
-               self.saved = self.origin;
+       self.saved = self.fld;
 
        f = BGMScript(self);
        if(f >= 0)
@@ -74,13 +72,16 @@ void Ent_Wall_Remove()
 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();
 
@@ -97,6 +98,7 @@ void Ent_Wall()
                self.origin_x = ReadCoord();
                self.origin_y = ReadCoord();
                self.origin_z = ReadCoord();
+               setorigin(self, self.origin);
        }
 
        if(f & 4)
@@ -140,6 +142,7 @@ void Ent_Wall()
                }
                else
                        self.mins = self.maxs = '0 0 0';
+               setsize(self, self.mins, self.maxs);
 
                if(self.bgmscript)
                        strunzone(self.bgmscript);
@@ -170,10 +173,7 @@ void Ent_Wall()
 
        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;
index d3d57aba9e8cbcd52ad7606466f912dc394032a9..39b60a66b0c767d1342bec2dcb5e8645d6cd332a 100644 (file)
@@ -688,6 +688,7 @@ void Ent_WaypointSprite()
                self.origin_x = ReadCoord();
                self.origin_y = ReadCoord();
                self.origin_z = ReadCoord();
+               setorigin(self, self.origin);
        }
 
        if(sendflags & 1)
index 07998d09c67b774b2636b61b13198318fe231283..fe176e3167da3d8dd916f4cd17afea04db7958de 100644 (file)
@@ -40,8 +40,9 @@ void Curl_URI_Get_Callback(float id, float status, string data)
                cvar_set(do_cvar, data);
                strunzone(do_cvar);
        }
-       if(!do_exec && !do_cvar)
-               print(data);
+       if(!do_exec)
+               if not(do_cvar)
+                       print(data);
 }
 
 
index 05c93865dbcceed7c2606d9cb567b727e3fe8ad7..f7ced420579acb32837ea61f04511d39ddac86f5 100644 (file)
@@ -38,7 +38,7 @@ void MapInfo_Cache_Store()
                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));
@@ -65,7 +65,7 @@ float MapInfo_Cache_Retrieve(string map)
                return 0;
 
        s = db_get(_MapInfo_Cache_DB_NameToIndex, map);
-       if(!s)
+       if(s == "")
                return 0;
        i = stof(s);
 
@@ -89,6 +89,8 @@ float _MapInfo_globhandle;
 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
 }
@@ -96,11 +98,19 @@ string _MapInfo_GlobItem(float i)
 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)
index 869a44bc8bf6b2253a85f4d07227f8c4bce23bc8..625e091dcc68994ca9a3e5bdd8f4a327f3a1cff9 100644 (file)
@@ -15,7 +15,7 @@ void sv_notice_join_think()
 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();
@@ -72,7 +72,7 @@ float cl_notice_run()
     #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);
index 0f195d73ba7166726f3c52ee72c3669278086eb6..dffce2f2bb0e206c3a73b296b7136f82daecb18f 100644 (file)
 # 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
index 3b54e08d0d72ed7b5fdf5878eb0260c3344f7361..404bd7e5a486012deec784cb14be934f0c5cd85c 100644 (file)
@@ -1476,8 +1476,12 @@ float isGametypeInFilter(float gt, float tp, float ts, string pattern)
                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;
 }
index c9f1f49f418aeff4d97f012b6e9b3a8f220fbc49..4e553e4ba5d1611fc73fa83289c45b0d0de27b57 100644 (file)
@@ -224,8 +224,13 @@ void WriteInt24_t(float dest, float val);
 #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);
 
index feb77538758e0138c6bb7fce4e5f04df5b793866..85e2f15ee99ca82f51732b0ff8ca4faaaf09d61b 100644 (file)
@@ -173,9 +173,9 @@ void CSQCModel_InterpolateAnimation_Do()
 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()
@@ -207,9 +207,9 @@ void CSQCModel_Read(float isnew)
        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
index 817bc531e7fd7aebe7e3341e788bf8d8690db0fe..2ed78fbd8c3b92247ecae15a36525358e9a2f7f7 100644 (file)
@@ -120,7 +120,7 @@ void InterpolateOrigin_Do()
 }
 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)
index f838257c564d9c7899b694da1c73ecec1254b40c..0a3a55c5f1d4bc214045b2c32731adac5779c156 100644 (file)
@@ -19,7 +19,6 @@
 #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"
@@ -67,7 +66,6 @@
 #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"
index f342de066659133089b673d1161c329bbf27a12c..2c0b1edf38aa33fcd42e6117bf4a5c6c108bd04a 100644 (file)
@@ -110,9 +110,5 @@ void GameCommand(string theCommand)
                return;
        }
 
-       if(argv(0) == "curl")
-       {
-       }
-
        print(_("Invalid command. For a list of supported commands, try menu_cmd help.\n"));
 }
index 20bc4ab9c911459c109cb7ebf57001b108a00a46..6b32bae27080d279c760923b4ddd613868469079 100644 (file)
@@ -9,7 +9,7 @@ CLASS(Button) EXTENDS(Label)
        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)
@@ -81,7 +81,8 @@ float Button_mouseRelease(entity me, vector pos)
                {
                        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;
        }
@@ -162,7 +163,8 @@ void Button_draw(entity me)
        {
                // 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;
 
diff --git a/qcsrc/menu/item/gecko.c b/qcsrc/menu/item/gecko.c
deleted file mode 100644 (file)
index 5a69c3b..0000000
+++ /dev/null
@@ -1,97 +0,0 @@
-// 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
index 60da88a09ca957307f3616e57526f2e3b19a0e19..c32057da8d2665e10655220354fd0aa85bee5dbb 100644 (file)
@@ -247,7 +247,7 @@ void ListBox_updateControlTopBottom(entity me)
 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
index bccf5c8d61ea28fbf50e2191efe8482786382be6..ddf9ff686adc7b4413086cab0093d08fc6aa0a7a 100644 (file)
@@ -16,8 +16,6 @@ float menuInitialized;
 float menuNotTheFirstFrame;
 float menuMouseMode;
 
-void SUB_Null() { }
-
 void m_sync()
 {
        updateCompression();
@@ -55,7 +53,7 @@ void m_init()
        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)
index 641ddf7d19df20db49ad73d707a74197cf427ad5..b6c0795a8544424d505b8392d8d7f4f7cec59825 100644 (file)
@@ -33,8 +33,6 @@ entity keyGrabber;
 
 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.
index 0f545e60cfa368967ca4cb6f694132fff6558fd1..e45a4813a6d257bc512e10dbae643c0db61500fa 100644 (file)
@@ -1,7 +1,9 @@
 ../../menu.dat
 
+sys-pre.qh
 ../dpdefs/menudefs.qc
 ../dpdefs/keycodes.qc
+sys-post.qh
 
 config.qh
 ../common/util-pre.qh
diff --git a/qcsrc/menu/sys-post.qh b/qcsrc/menu/sys-post.qh
new file mode 100644 (file)
index 0000000..e466fb4
--- /dev/null
@@ -0,0 +1 @@
+#pragma noref 0
diff --git a/qcsrc/menu/sys-pre.qh b/qcsrc/menu/sys-pre.qh
new file mode 100644 (file)
index 0000000..a964ae9
--- /dev/null
@@ -0,0 +1 @@
+#pragma noref 1
index 66f292a0369588ae675b237fc0580d1d8cf34a04..eb9590827da99ce9c835a1e559f29d1758734d63 100644 (file)
@@ -53,7 +53,7 @@ vector hslimage_color(vector v, vector margin)
 
 vector color_hslimage(vector v, vector margin)
 {
-       vector pos;
+       vector pos = '0 0 0';
        v = rgb_to_hsl(v);
        if (v_y)
        {
index b31622f67390e02f1d1465b02c5b55652fab1907..e3cd78eb6a56ba17f982a9c24456176f724c4502 100644 (file)
@@ -33,8 +33,8 @@ void XonoticHUDWeaponsDialog_fill(entity me)
                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");
diff --git a/qcsrc/menu/xonotic/dialog_news.c b/qcsrc/menu/xonotic/dialog_news.c
deleted file mode 100644 (file)
index f638c77..0000000
+++ /dev/null
@@ -1,20 +0,0 @@
-#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
index 2a9c094b8eb07a74ac6752562b3eecfb87cd200a..dbbcc7b0c495af9609cae5dfac612b2ef4da9f74 100644 (file)
@@ -5,9 +5,9 @@ CLASS(XonoticInputBox) EXTENDS(InputBox)
        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)
@@ -55,7 +55,8 @@ void XonoticInputBox_setText(entity me, string new)
        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);
        }
@@ -85,7 +86,8 @@ float XonoticInputBox_keyDown(entity me, float key, float ascii, float shift)
                        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;
index fe91b0650a0888a911f828c3d371395f1e0c6d6c..c37481b9763763ea066f942639a01604a7f0e050 100644 (file)
@@ -167,7 +167,6 @@ void XonoticMapList_drawListBoxItem(entity me, float i, vector absSize, float is
 {
        // layout: Ping, Map name, Map name, NP, TP, MP
        string s;
-       float p;
        float theAlpha;
        float included;
 
index c7f733a195fe605cbe823d34ca11a7f6ef2833c0..9e49626023375b96651e5fa13bc4c2e50d0f6c54 100644 (file)
@@ -733,11 +733,11 @@ void XonoticServerList_drawListBoxItem(entity me, float i, vector absSize, float
        // 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;
 
index 4c03eaa5f9caa9edb5255ee3f4a217a904799463..e80bf30e4e410b183ca23dc487b6f15afd1ae5b1 100644 (file)
@@ -465,7 +465,7 @@ float preMenuInit()
 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
@@ -473,13 +473,12 @@ void postMenuDraw()
 {
        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();
 
index b450f761e31af442b2c084763e97fd44ae5faf84..0259a5756ea1620c4ab21be3a9f5df3c2dc920c3 100644 (file)
@@ -166,7 +166,7 @@ void() monsterinwall =
        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;
 }
index c95c2eaf2f819513fee854a5eaaf73ccf9ea426d..eb1105b933f7cec36e83cdd69074dc1dc12bff98 100644 (file)
@@ -170,7 +170,7 @@ void zombie_die(vector dir)
     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;
index d3f4b55f4a49acf42693df6e04df24942a1b99f3..a0e4dc097d8585cfc1e88e9f7ffebc0eb9800471 100644 (file)
@@ -165,7 +165,7 @@ void GiveBall (entity plyr, entity ball)
 
        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.
 
@@ -235,7 +235,7 @@ void ResetBall (void)
        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)
@@ -394,7 +394,7 @@ void GoalTouch (void)
        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);
 }
 
index f7845637121c90e6cb2f58c80f314391d8990e5d..067b174369ea3cd8f1b0b22c6d83ded256f880ca 100644 (file)
@@ -261,7 +261,7 @@ void bumb_spawn()
 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;
index d682e78f89c54f97d58afec8c44afd55df8de662..1a94bca8930f5c55628abe11c6b56ec9b3d20c7d 100644 (file)
@@ -868,7 +868,6 @@ string autocvar_g_hitplots_individuals;
 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;
@@ -1228,6 +1227,7 @@ float autocvar_sv_vote_singlecount;
 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;
index 3e1cae313ff6ecbc06c3629d699c911bb16abb42..45107b833a1b16221b8082da7c55c143d7b9244b 100644 (file)
@@ -45,7 +45,7 @@ void bot_think()
 
        if (autocvar_g_campaign && !campaign_bots_may_start)
        {
-               self.nextthink = time + 0.5;
+               self.bot_nextthink = time + 0.5;
                return;
        }
 
@@ -85,7 +85,7 @@ void bot_think()
        {
                // block the bot during the countdown to game start
                self.movement = '0 0 0';
-               self.nextthink = game_starttime;
+               self.bot_nextthink = game_starttime;
                return;
        }
 
@@ -135,16 +135,15 @@ void bot_setnameandstuff()
        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)
@@ -393,7 +392,7 @@ void bot_clientconnect()
        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();
index cf5ec278b2ec503aa1b2d0b9081d26dba824df02..0766ab0466dbe24fc9ae2bed9ecb2ce529eeef5d 100644 (file)
@@ -375,12 +375,8 @@ float waypoint_load_links()
                return FALSE;
        }
 
-       while (1)
+       while ((s = fgets(file)))
        {
-               s = fgets(file);
-               if (!s)
-                       break;
-
                tokens = tokenizebyseparator(s, "*");
 
                if (tokens!=2)
@@ -473,12 +469,8 @@ void waypoint_load_links_hardwired()
                return;
        }
 
-       for (;;)
+       while ((s = fgets(file)))
        {
-               s = fgets(file);
-               if (!s)
-                       break;
-
                if(substring(s, 0, 2)=="//")
                        continue;
 
@@ -687,18 +679,15 @@ float waypoint_loadall()
        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);
index 7ccbacbf314fd191cde32f899bfa1c86e2f36593..1dcbf0d1f5bb8df19a81d03b76957e3c8a853aaf 100644 (file)
@@ -7,9 +7,9 @@ void send_CSQC_teamnagger() {
 }
 
 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) {
@@ -471,7 +471,7 @@ void PutObserverInServer (void)
        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;
@@ -787,7 +787,7 @@ void PutClientInServer (void)
                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;
@@ -1355,7 +1355,7 @@ void ClientConnect (void)
        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";
@@ -1538,8 +1538,6 @@ void ClientConnect (void)
        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);
@@ -1635,8 +1633,6 @@ void ClientDisconnect (void)
        bprint ("^4",self.netname);
        bprint ("^4 disconnected\n");
 
-       SoundEntity_Detach(self);
-
        DropAllRunes(self);
        MUTATOR_CALLHOOK(ClientDisconnect);
 
@@ -1782,15 +1778,9 @@ void player_powerups (void)
        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);
 
@@ -3033,10 +3023,6 @@ void PlayerPostThink (void)
                if (intermission_running)
                        return;         // intermission or finale
                GetPressedKeys();
-       } else if (self.classname == "observer") {
-               //do nothing
-       } else if (self.classname == "spectator") {
-               //do nothing
        }
        
 #ifdef TETRIS
@@ -3089,7 +3075,7 @@ void PlayerPostThink (void)
 
        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)
                {
index 876608745dce17b1dea69d02373d6feca26b14a2..03347a9c86d2cb718abae96a77c1eb855feb38a6 100644 (file)
@@ -26,7 +26,7 @@ void WeaponStats_ready(entity fh, entity pass, float status)
                        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"));
index 0303921e609c5ff8dd3f2c8d2fe5099034e52b82..a84a8a51bd7b2f0fdae6d2681b4ab2485c404de0 100644 (file)
@@ -1189,7 +1189,7 @@ vector findperpendicular(vector v)
 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;
index eae71b045c82845688d653b999d705f07854ac68..53ad41d3551d0d7de500622a31f224ec87b52ef1 100644 (file)
@@ -572,7 +572,7 @@ void CommonCommand_timeout(float request, entity caller) // DEAR GOD THIS COMMAN
                                {                                       
                                        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;
@@ -614,7 +614,7 @@ void CommonCommand_who(float request, entity caller, float argc)
                        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"));
                        
index 2dd52317569ab862e62a3a01ae56fe98c1b1761f..0710ddfa8474874cca23787d9ed6221e44660ebd 100644 (file)
@@ -830,8 +830,6 @@ void GameCommand_animbench(float request, float argc)
                case CMD_REQUEST_COMMAND:
                {
                        entity tmp_entity;
-                       float i;
-                       vector v;
 
                        if(argc >= 4)
                        {
index e4564753008b889303ab4992bb4afbfd2f71edbd..abdae75d5e73f62c6feed4bbf25ba8580e948a05 100644 (file)
@@ -172,7 +172,7 @@ void VoteSpam(float notvoters, float mincount, string result)
                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)
        {
@@ -483,7 +483,7 @@ string ValidateMap(string validated_map, entity caller)
 {
        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;
@@ -694,6 +694,7 @@ void VoteCommand_call(float request, entity caller, float argc, string vote_comm
                        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."); }
index 4138c2945ed970f14a876e7e8b77553ff777560b..ca01caf9ca3098c855a0d716c01fdba697488ad4 100644 (file)
@@ -586,7 +586,7 @@ string deathmessage;
 #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;
index 0a2fe02b66fcf13c88c02240c0fb5b653f31ed88..6a0dcdf8b4e01679d23dfd1576c581e2c061e3ce 100644 (file)
@@ -355,7 +355,7 @@ void dom_controlpoint_setup()
 
        self.cnt = -1;
 
-       if(!self.message)
+       if(self.message == "")
                self.message = " has captured a control point";
 
        if(self.DOMPOINTFRAGS <= 0)
index 4d29b014faff68c9528bb954d3d51512e88b6d3e..58e737e58c55fd72de7990f8082d6c334c2727f2 100644 (file)
@@ -115,7 +115,7 @@ void func_breakable_behave_destroyed()
        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();
 }
@@ -240,9 +240,9 @@ void spawnfunc_func_breakable() {
        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;
index 189cd9b05633b3c8bc1fd0993f879156057533a3..a3eeefb73033ce71cfa2532ce575378af314904e 100644 (file)
@@ -310,13 +310,13 @@ void LogDeath(string mode, float deathtype, entity killer, entity killed)
 
 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)
@@ -339,7 +339,7 @@ void Send_CSQC_KillCenterprint(entity e, string s1, string s2, float msg, float
 void Obituary (entity attacker, entity inflictor, entity targ, float deathtype)
 {
        string  s, a, msg;
-       float w, type;
+       float type;
 
        if (targ.classname == "player")
        {
index 8867d0725b0f7c3a6cea40d022c5e133a01291dc..f7af47d924036f121a6b8340a8dc2df5a0edaee4 100644 (file)
@@ -79,7 +79,7 @@ void GrapplingHook_Stop()
        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;
index b5f4bcf8441b0f382dd10813e60c1517c80107be..854b7fef24f7466c86a373ec784ed69fea9cc420 100644 (file)
@@ -96,7 +96,7 @@ void spawnfunc_dynlight()
        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)
index 9f4c22a02697d9e72213b4fa0350a8c4b021bf91..371f9da399ee9988cd7982b9f887239d95dbe1cc 100644 (file)
@@ -1,6 +1,4 @@
-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;
@@ -267,7 +265,7 @@ void SUB_CalcMove_Bezier (vector tcontrol, vector tdest, float tspeed, void() fu
        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
index 20ddc655170cfbc483ff0b41fe22ccec1e2c2284..293c78f001f0f3a2df0c050d91102db2b53a4289 100644 (file)
@@ -66,7 +66,7 @@ void SUB_UseTargets()
                if(clienttype(activator) == CLIENTTYPE_REAL)
                {
                        centerprint (activator, self.message);
-                       if (!self.noise)
+                       if (self.noise == "")
                                play2(activator, "misc/talk.wav");
                }
        }
@@ -192,7 +192,7 @@ void multi_trigger()
        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;
        }
 }
 
@@ -254,7 +254,8 @@ void multi_reset()
                self.takedamage = DAMAGE_YES;
                self.solid = SOLID_BBOX;
        }
-       self.think = SUB_Null;
+       self.think = func_null;
+       self.nextthink = 0;
        self.team = self.team_saved;
 }
 
@@ -359,7 +360,8 @@ void delay_use()
 
 void delay_reset()
 {
-       self.think = SUB_Null;
+       self.think = func_null;
+       self.nextthink = 0;
 }
 
 void spawnfunc_trigger_delay()
@@ -506,9 +508,9 @@ void spawnfunc_trigger_hurt()
        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";
 
@@ -1337,9 +1339,9 @@ void spawnfunc_misc_laser()
        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;
index dc615afb6285b116009ef39c1372bd0e3016f216..8d8c0328ec6abed9d4e4e7c7d516fb4249faf260 100644 (file)
@@ -1613,6 +1613,8 @@ void NextLevel()
        if(autocvar_g_campaign)
                CampaignPreIntermission();
 
+       MUTATOR_CALLHOOK(MatchEnd);
+
        localcmd("\nsv_hook_gameend\n");
 }
 
@@ -2348,7 +2350,7 @@ string MapVote_Suggest(string m)
        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))
index 38a1e249d7847a954e20a9df455dd2dfa8289b67..08fd83fe3fab99c12c6a448e5f6198328281523c 100644 (file)
@@ -431,8 +431,12 @@ float Ban_IsClientBanned(entity client, float idx)
                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;
 }
 
index 626e535b4517f0614c0da9464846fa2682d03279..1b423f5020f5646312a3c0b8d7a14380bb073344 100644 (file)
@@ -186,7 +186,7 @@ void spawnfunc_item_key() {
                _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;
@@ -203,14 +203,14 @@ void spawnfunc_item_key() {
                _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
@@ -218,14 +218,14 @@ void spawnfunc_item_key() {
                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
@@ -391,11 +391,11 @@ void spawnfunc_trigger_keylock(void) {
        }
 
        // 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)
@@ -405,11 +405,11 @@ void spawnfunc_trigger_keylock(void) {
        }
        
        // 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
index eed2006a5bd63eb60a9cf27c13fe1c40ec5f2193..efb73540672df091703c6649b2aa90e7862ffb2b 100644 (file)
@@ -428,7 +428,7 @@ string formatmessage(string msg)
                        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'));
@@ -1599,9 +1599,6 @@ void precache()
     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");
@@ -1824,7 +1821,7 @@ void InitializeEntitiesRun()
             self = e_old;
         }
         //dprint("Delayed initialization: ", self.classname, "\n");
-        if(func != func_null)
+        if(func)
             func();
         else
         {
@@ -1838,7 +1835,6 @@ void InitializeEntitiesRun()
 
 .float uncustomizeentityforclient_set;
 .void(void) uncustomizeentityforclient;
-void(void) SUB_Nullpointer = #0;
 void UncustomizeEntitiesRun()
 {
     entity oldself;
@@ -1851,7 +1847,7 @@ void SetCustomizer(entity e, float(void) customizer, void(void) uncustomizer)
 {
     e.customizeentityforclient = customizer;
     e.uncustomizeentityforclient = uncustomizer;
-    e.uncustomizeentityforclient_set = (uncustomizer != SUB_Nullpointer);
+    e.uncustomizeentityforclient_set = !!uncustomizer;
 }
 
 .float nottargeted;
@@ -2529,43 +2525,6 @@ vector gettaginfo_relative(entity e, float tag)
     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)
index 9be5745cb5e4ec24afbde80bee85c4e58bf94097..368ab589824ef5a66464d99283c7d223184cdf3f 100644 (file)
@@ -101,7 +101,7 @@ float Mutator_Add(mutatorfunc_t func, string name)
        {
                if(name == loaded_mutators[i])
                        return 1; // already added
-               if(!loaded_mutators[i])
+               if not(loaded_mutators[i])
                        j = i;
        }
        if(j < 0)
index 5d97b2af955d0ac00c66924277b90fb4f5eccbce..908d81cf3fe0a9d96b13a1c529a8db568f5008a9 100644 (file)
@@ -1985,7 +1985,7 @@ MUTATOR_HOOKFUNCTION(ctf_MatchEnd)
                                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;
                        }
                        
index 07c96671c67e28b0eddc529b6e83bb58aa79d369..9f8647d9dfa5cab3a61a1a37735360bcaf4602ec 100644 (file)
@@ -89,7 +89,7 @@ void ka_TouchEvent() // runs any time that the ball comes in contact with someth
        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;
index 808d1a29b35229d56931b9645642a524d95e833b..5f27b60a55f882e851cc99fe5bc876fec16e5601 100644 (file)
@@ -124,7 +124,7 @@ void GiveBall(entity plyr, entity ball)
 
        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.
 
@@ -205,7 +205,7 @@ void ResetBall(void)
        {
                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)
@@ -387,7 +387,7 @@ void GoalTouch(void)
        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);
 }
 
@@ -668,7 +668,7 @@ void W_Nexball_Touch(void)
 {
        entity ball, attacker;
        attacker = self.owner;
-       //self.think = SUB_Null;
+       //self.think = func_null;
        //self.enemy = world;
        
        PROJECTILE_TOUCH;
@@ -773,14 +773,13 @@ void W_Nexball_Attack2(void)
        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;
        }               
        
index 6508163764cec58af87dc6cac09a97b1f8b6c67d..8137cc3047d35ed2822d17a9841415e83c991ff5 100644 (file)
@@ -630,7 +630,7 @@ void onslaught_generator_damage(entity inflictor, entity attacker, float damage,
                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
@@ -1315,8 +1315,8 @@ void onslaught_controlpoint_reset()
        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');
 
index ce4c2b4b8d74a40c13455b05d9020f05473e7cfc..3cb4ca750ee15f971eb5a9a59b772b0c9445d83a 100644 (file)
@@ -214,7 +214,7 @@ float edge_show(vector point,float fsize)
 #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;
 
@@ -248,7 +248,7 @@ vector pathlib_wateroutnode(vector start,vector end)
     return end;
 }
 
-vector pathlib_swimnode(vector start,vector end)
+vector pathlib_swimnode(vector start,vector end,float doedge)
 {
     pathlib_movenode_goodnode = 0;
 
index 9369fb4d69f2a179ff47ac74c8677e49349a1449..c45ac0dee4bb266fc1f36552037dffc94b625198 100644 (file)
@@ -1,4 +1,4 @@
-vector pathlib_wateroutnode(vector start,vector end)
+vector pathlib_wateroutnode(vector start,vector end, float doedge)
 {
     vector surface;
 
@@ -32,7 +32,7 @@ vector pathlib_wateroutnode(vector start,vector end)
     return end;
 }
 
-vector pathlib_swimnode(vector start,vector end)
+vector pathlib_swimnode(vector start,vector end, float doedge)
 {
     pathlib_movenode_goodnode = 0;
 
@@ -43,7 +43,7 @@ vector pathlib_swimnode(vector start,vector end)
     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)
@@ -52,7 +52,7 @@ vector pathlib_swimnode(vector start,vector end)
     return end;
 }
 
-vector pathlib_flynode(vector start,vector end)
+vector pathlib_flynode(vector start,vector end, float doedge)
 {
     pathlib_movenode_goodnode = 0;
 
index 71d13caa4e084660b568389f7f96031e54bfafc1..d1b6667d715f4a6075f992f999ceb846a608e339 100644 (file)
@@ -75,9 +75,9 @@ vector movenode_boxmax;
 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);
 
index 5ddad200fe752499c8dffb78ef2db4b549407202..53f39091393a616b6dcb33399df15b66fec2ebda 100644 (file)
@@ -70,7 +70,7 @@ void PlayerStats_AddPlayer(entity e)
        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);
@@ -146,7 +146,7 @@ void PlayerStats_AddEvent(string event_id)
 
 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;
@@ -225,7 +225,7 @@ void PlayerStats_ready(entity fh, entity pass, float status)
                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()));
@@ -338,7 +338,7 @@ void PlayerStats_AddGlobalInfo(entity p)
 {
        if(playerstats_db < 0)
                return;
-       if(!p.playerstats_id || playerstats_db < 0)
+       if((p.playerstats_id == "") || playerstats_db < 0)
                return;
        p.playerstats_addedglobalinfo = TRUE;
 
@@ -366,19 +366,27 @@ void PlayerStats_AddGlobalInfo(entity p)
        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);
@@ -387,6 +395,7 @@ void PlayerStats_EndMatch(float finished)
                        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);
                }
        }
 }
index 11a311028d9d13c70ffdbeb32999c852d5cc1183..f3806d50df917fe39a165663fd62fa3f0937578c 100644 (file)
@@ -6,6 +6,7 @@ string PLAYERSTATS_MATCHES = "matches";
 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-";
index 75dae14bf5f28d666e9beb91e820e912389a1a54..3e83c972eece82f015fafae1804b1e6db6a0ddda 100644 (file)
@@ -309,8 +309,8 @@ void Portal_MakeBrokenPortal(entity portal)
 {
        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;
@@ -320,8 +320,8 @@ void Portal_MakeWaitingPortal(entity portal)
 {
        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;
@@ -342,8 +342,8 @@ void Portal_MakeOutPortal(entity portal)
 {
        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;
index c7c38165dd9845225420660ddede82ae65de8dd5..6aaa19803a5410e1c96316ed7c27e68c8b46c5c3 100644 (file)
@@ -817,11 +817,11 @@ void spawnfunc_trigger_race_checkpoint()
        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;
@@ -870,11 +870,11 @@ void spawnfunc_target_checkpoint() // defrag entity
        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")
@@ -1026,7 +1026,7 @@ void race_ReadyRestart()
        Score_NicePrint(world);
 
        race_ClearRecords();
-       PlayerScore_Sort(race_place);
+       PlayerScore_Sort(race_place, 1);
 
        entity e;
        FOR_EACH_CLIENT(e)
@@ -1102,7 +1102,7 @@ void spawnfunc_trigger_race_penalty()
        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;
index 7116c33874d8cb7437c0bf01584ca7228a48d06b..ba8f648c888b33e0e312cdf8774b3e1cd0169cad 100644 (file)
@@ -165,7 +165,7 @@ void rune_respawn();
 void RuneCarriedThink()
 {
        float rcount, rnum;
-       vector ang;
+       vector ang = '0 0 0';
        entity rune;
 
        if(self.owner.classname != "player" || time < game_starttime)
@@ -219,11 +219,11 @@ void rune_touch()
 
        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);
index 102dd6a33ef326af860bdd8d66c0ba537f5f8a89..c2307ad3756208e08b7329ce90e7c2c8712a004a 100644 (file)
@@ -10,9 +10,9 @@ var .float teamscores_primary;
 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;
@@ -123,7 +123,7 @@ float TeamScore_Add(entity player, float scorefield, float score)
        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;
 
@@ -133,8 +133,12 @@ float TeamScore_Compare(entity t1, entity t2)
        {
                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;
 }
 
@@ -352,7 +356,7 @@ float PlayerTeamScore_Add(entity player, float pscorefield, float tscorefield, f
        return r;
 }
 
-float PlayerScore_Compare(entity t1, entity t2)
+float PlayerScore_Compare(entity t1, entity t2, float strict)
 {
        if(!t1 || !t2) return (!t2) - !t1;
 
@@ -362,8 +366,12 @@ float PlayerScore_Compare(entity t1, entity t2)
        {
                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;
 }
 
@@ -409,7 +417,7 @@ void WinningConditionHelper()
                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;
@@ -419,7 +427,7 @@ void WinningConditionHelper()
                        }
                        else
                        {
-                               c = TeamScore_Compare(secondscorekeeper, sk);
+                               c = TeamScore_Compare(secondscorekeeper, sk, 1);
                                if(c < 0)
                                {
                                        WinningConditionHelper_secondteam = t + 1;
@@ -428,7 +436,7 @@ void WinningConditionHelper()
                        }
                }
 
-               WinningConditionHelper_equality = (TeamScore_Compare(winnerscorekeeper, secondscorekeeper) == 0);
+               WinningConditionHelper_equality = (TeamScore_Compare(winnerscorekeeper, secondscorekeeper, 0) == 0);
                if(WinningConditionHelper_equality)
                        WinningConditionHelper_winnerteam = WinningConditionHelper_secondteam = -1;
 
@@ -449,7 +457,7 @@ void WinningConditionHelper()
                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;
@@ -459,7 +467,7 @@ void WinningConditionHelper()
                        }
                        else
                        {
-                               c = PlayerScore_Compare(secondscorekeeper, sk);
+                               c = PlayerScore_Compare(secondscorekeeper, sk, 1);
                                if(c < 0)
                                {
                                        WinningConditionHelper_second = p;
@@ -468,7 +476,7 @@ void WinningConditionHelper()
                        }
                }
 
-               WinningConditionHelper_equality = (PlayerScore_Compare(winnerscorekeeper, secondscorekeeper) == 0);
+               WinningConditionHelper_equality = (PlayerScore_Compare(winnerscorekeeper, secondscorekeeper, 0) == 0);
                if(WinningConditionHelper_equality)
                        WinningConditionHelper_winner = WinningConditionHelper_second = world;
 
@@ -657,7 +665,7 @@ string GetTeamScoreString(float tm, float shortString)
        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)
@@ -666,19 +674,17 @@ float PlayerTeamScore_Compare(entity p1, entity p2)
                        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;
 
@@ -694,14 +700,14 @@ entity PlayerScore_Sort(.float field)
        
        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;
@@ -715,7 +721,11 @@ entity PlayerScore_Sort(.float field)
                        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;
@@ -857,7 +867,7 @@ void Score_NicePrint(entity to)
                        ++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)
index 3ac0b03b5577dd49cf5dbb5eea7e1ad7e2fd02e6..96f15bc804266766b2180ab56f22e99a1d11cf61 100644 (file)
@@ -118,4 +118,4 @@ string GetTeamScoreString(float tm, float shortString);
  * 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);
index 2694cb3d6f536ac506b49b4b05f0b07ee9a75389..54d60a14b6ee5b20ad5b3ed5549896d6aae6029a 100644 (file)
@@ -71,6 +71,6 @@ void spawnfunc_trigger_secret() {
        // 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;
 }
 
index 63d91f6070ca3ecee2ecb56527f7a0c6710c9a98..c91c1ac1895ecae9d49667175258f3b91b9f9486 100644 (file)
@@ -43,7 +43,18 @@ void CreatureFrame (void)
                        {
                                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)
                                        {
@@ -64,10 +75,6 @@ void CreatureFrame (void)
                                                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
index b56dfec47d56a79f158cbad1d4e2c74a026467cd..bd6b9962cc2d623b81a13db5e3733c3b562e5a17 100644 (file)
@@ -504,17 +504,17 @@ void Item_RespawnCountdown (void)
                                        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)
@@ -834,7 +834,7 @@ void Item_Reset()
 
        if(self.classname != "droppedweapon")
        {
-               self.think = SUB_Null;
+               self.think = func_null;
                self.nextthink = 0;
 
                if(self.waypointsprite_attached)
index 2458e262f27fae92a74d7ab48c1bced632ebcac4..5a5042b3d48a63dc1a273feff50b33e767a7de8f 100644 (file)
@@ -240,7 +240,7 @@ void trigger_push_touch()
 
        if (self.spawnflags & PUSH_ONCE)
        {
-               self.touch = SUB_Null;
+               self.touch = func_null;
                self.think = SUB_Remove;
                self.nextthink = time;
        }
index 8c2766295e7ca3cad676c15247e82c9581404a11..0b9da88faf2b97fc524f472364bc2ae4f6dabc7f 100644 (file)
@@ -158,7 +158,7 @@ void plat_crush()
 
 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();
@@ -191,9 +191,9 @@ void spawnfunc_func_plat()
     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)
@@ -282,7 +282,7 @@ void train_next()
        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)
@@ -302,7 +302,7 @@ void func_train_find()
        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;
@@ -319,7 +319,7 @@ void spawnfunc_func_train()
        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;
@@ -332,9 +332,9 @@ void spawnfunc_func_train()
        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;
@@ -395,9 +395,9 @@ void spawnfunc_func_rotating()
        
        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";
 
 
@@ -414,7 +414,7 @@ void spawnfunc_func_rotating()
 
        // 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
 }
@@ -469,9 +469,9 @@ void spawnfunc_func_bobbing()
 
        // 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;
@@ -495,7 +495,7 @@ void spawnfunc_func_bobbing()
        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;
@@ -542,9 +542,9 @@ void spawnfunc_func_pendulum()
                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;
@@ -572,7 +572,7 @@ void spawnfunc_func_pendulum()
        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;
 
@@ -1303,9 +1303,9 @@ void LinkDoors()
        {
                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;
@@ -1388,7 +1388,8 @@ void door_reset()
        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)
@@ -1419,9 +1420,9 @@ void spawnfunc_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)
@@ -1500,7 +1501,8 @@ void door_rotating_reset()
        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()
@@ -1544,9 +1546,9 @@ void spawnfunc_func_door_rotating()
     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)
@@ -1613,7 +1615,6 @@ float SECRET_1ST_DOWN = 4;                // 1st move is down from arrow
 float SECRET_NO_SHOOT = 8;             // only opened by trigger
 float SECRET_YES_SHOOT = 16;   // shootable even if targeted
 
-
 void fd_secret_use()
 {
        float temp;
@@ -1664,6 +1665,11 @@ void fd_secret_use()
                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()
 {
@@ -1769,7 +1775,8 @@ void secret_reset()
                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
@@ -1819,7 +1826,7 @@ void spawnfunc_func_door_secret()
        {
                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)
@@ -1886,9 +1893,9 @@ void spawnfunc_func_fourier()
        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;
@@ -1909,7 +1916,7 @@ void spawnfunc_func_fourier()
        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;
@@ -2049,9 +2056,9 @@ void spawnfunc_func_vectormamamam()
                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;
@@ -2065,7 +2072,7 @@ void spawnfunc_func_vectormamamam()
 
        // 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;
index 2cfdd8a7720f5bf665d22ed5d7916da177375887..9a17d90c0c53bac0a71e9d2187f057f89add046a 100644 (file)
@@ -325,7 +325,7 @@ void spawnfunc_trigger_teleport (void)
        // 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;
index 48f76219bd40a6417432422749ab5800f57a1c0f..971d65cca3916eea9f99a17d28b5d41ee096211f 100644 (file)
@@ -18,7 +18,7 @@ void turret_stdproc_die()
     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;
@@ -120,8 +120,8 @@ void turret_stdproc_damage (entity inflictor, entity attacker, float damage, flo
     
     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;
index 891941c9304d49d1bd047ffeab692db22062778a..dd58b3cee2860e0c031dc131a47eab165c846967 100644 (file)
@@ -145,7 +145,7 @@ void turret_projectile_explode()
 {
     
     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);
index 5a94b442343832f8ebceef28639d72cd9e277ae0..2e3a006881384a955203649f32eebd961d8f3c62 100644 (file)
@@ -45,7 +45,7 @@ vector shortangle_v(vector ang1, vector ang2)
 
 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);
index 4b0f1d13a4b5b8976eda70b150523fccebd86724..b9c7dbfb8339e406603dbbea763f63c28ea81c24 100644 (file)
@@ -236,7 +236,7 @@ void bumb_gunner_exit(float _exitflag)
        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;
@@ -307,7 +307,7 @@ float bumb_gunner_enter()
        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;
@@ -794,7 +794,7 @@ void bumb_die()
        if(random() > 0.5)
                _body.touch = bumb_blowup;
        else
-               _body.touch = SUB_Null;
+               _body.touch = func_null;
                
        _body.think = bumb_diethink;
        _body.nextthink = time;
@@ -805,7 +805,7 @@ void bumb_die()
        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;
@@ -814,7 +814,7 @@ void bumb_die()
        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);
index 792be585023d064650cad8f9360b771d1d16a4f0..93b27df9756a0deb3ef6452ebfc77e6df2878252 100644 (file)
@@ -74,7 +74,7 @@ float autocvar_g_vehicle_racer_bouncestop;
 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)
 {
@@ -545,7 +545,7 @@ void racer_blowup()
                                        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;
 
@@ -554,8 +554,6 @@ void racer_blowup()
     self.velocity  = '0 0 0';
 
     setorigin(self, self.pos1);
-       self.think     = racer_spawn;
-       self.nextthink = time + autocvar_g_vehicle_racer_respawntime;
 }
 
 void racer_deadtouch()
@@ -569,7 +567,7 @@ 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;
@@ -626,6 +624,10 @@ void racer_spawn(float _spawnflag)
     self.damageforcescale = 0.5;
     //self.destvec = autocvar_g_vehicle_racer_bouncepain;
 }
+void racer_spawn_default()
+{
+       racer_spawn(0);
+}
 
 
 
index a623bd540727afbe8f054c6b7fb65ec277004e14..11b9081a6022dc72d9cbbaf45596fbba0fc59308 100644 (file)
@@ -700,7 +700,7 @@ void raptor_blowup()
     self.velocity       = '0 0 0';
 
     setorigin(self, self.pos1);
-    self.touch = SUB_Null;
+    self.touch = func_null;
     self.nextthink = 0;
 }
 
@@ -720,7 +720,7 @@ void raptor_diethink()
 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;
index 6a307d53cf6f24b2bf5311d486faa4d833db169d..9bbdd096a259e609b5aa3bfdb46cc485f7393569 100644 (file)
@@ -286,7 +286,6 @@ void spiderbot_rocket_do()
                                    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;
@@ -736,9 +735,9 @@ void spiderbot_blowup()
 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;
index 95ab6575b8040fd3e794807d45a0f981d579787b..5e377079e01dd2fc0b1377fde2a884a17e50656a 100644 (file)
@@ -377,7 +377,7 @@ void vehicles_projectile_damage(entity inflictor, entity attacker, float damage,
     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;
     }
@@ -396,7 +396,7 @@ void vehicles_projectile_explode()
 
        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);
@@ -610,7 +610,7 @@ void vehicles_enter()
     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)
@@ -780,7 +780,7 @@ void vehicles_exit(float eject)
         _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;
index 834e6516787ba0411677ea34075cf769adb1bda3..f1d3890447140399b4206ac232694483aa42c1b1 100644 (file)
@@ -62,7 +62,6 @@ var .void() vehicle_die;    /// Vehicles custom function to be executed when veh
 #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;
 
index 3780fc71384d987160f8e56c3063166fdbcc1bb3..bbd9c647bcc8f578e6f5cd0a1e09652f281620ef 100644 (file)
@@ -229,7 +229,7 @@ void W_BallisticBullet_LeaveSolid_think()
 
        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;
 
@@ -628,7 +628,7 @@ float W_CheckProjectileDamage(entity inflictor, entity projowner, float deathtyp
 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)
        {
index 09a9ce84c9e7a29c6f999901636ec3ad895fc510..082e454ace2de00516090a35270868346ba7a8c8 100644 (file)
@@ -35,7 +35,7 @@ void W_Plasma_Explode (void)
                                        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)
        {
@@ -54,7 +54,7 @@ void W_Plasma_Explode_Combo (void)
 {
        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);
 }
index 67547e3583efef51458b138d926cfda5daf1ed2d..02557ad94e0da5db1a889ed76bb4abc2afe2fd7a 100644 (file)
@@ -14,7 +14,7 @@ void W_Fireball_Explode (void)
        vector dir;
        float d;
 
-       self.event_damage = SUB_Null;
+       self.event_damage = func_null;
        self.takedamage = DAMAGE_NO;
 
        // 1. dist damage
index 5f6c0346f5cf3c11137bf6e5271487fb764b263e..91b50fe7f76642cf336763a11243baa401a482d5 100644 (file)
@@ -14,7 +14,7 @@ void W_Grenade_Explode (void)
                                        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)
@@ -34,7 +34,7 @@ void W_Grenade_Explode2 (void)
                                        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)
index 9a4b1ef4495aa95d223d7df5cd15f7e770060f0b..55e361ebbcdb9ca395f145407edc9b0d957f07ef 100644 (file)
@@ -6,7 +6,7 @@ REGISTER_WEAPON(HAGAR, w_hagar, IT_ROCKETS, 8, WEP_FLAG_NORMAL | WEP_FLAG_RELOAD
 
 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);
@@ -14,7 +14,7 @@ void W_Hagar_Explode (void)
 
 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);
@@ -351,7 +351,7 @@ float w_hagar(float req)
        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
index a2697b2f5cb527050677ace98031e52896c6b83e..716d0a177cd811bc5c4f91acd7c5238384b1c719 100644 (file)
@@ -7,7 +7,7 @@ void W_HLAC_Touch (void)
 {
        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);
index 63d02604c4271f11cc808099f148f8946393bbf1..c6644f1003be9867516d17c0db4f15d828af9da3 100644 (file)
@@ -35,8 +35,8 @@ void W_Hook_ExplodeThink (void)
 
 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;
index 5e2bb075aa5c7ff1a4fd6b258ac2cea9661954a7..ecedc89fc1bb5748ccba92a8f7b7e750c49f3ae4 100644 (file)
@@ -9,7 +9,7 @@ void W_Laser_Touch (void)
 {
        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
index 4d98f0c91cd50927abfecdacd53c1b82c6a35dec..1b4f7c6cd06aa232811c06b67617006ba6f031d2 100644 (file)
@@ -45,7 +45,7 @@ void W_Mine_Stick (entity to)
 
        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;
@@ -67,7 +67,7 @@ void W_Mine_Explode ()
                                        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);
@@ -91,7 +91,7 @@ void W_Mine_Explode ()
 
 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)
index 2fba6144dd5ce7a855852de1c12ad755176855a1..add0207d12b57c8fd1ec90abd776143407bef84a 100644 (file)
@@ -25,7 +25,7 @@ void W_Rocket_Explode ()
                                        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);
@@ -46,7 +46,7 @@ void W_Rocket_DoRemoteExplode ()
 {
        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);
index 7cf6cfb73634e11be73aba7215de897f8ee7b715..975449f5d10c723c5fb765204c66641ae277e0c8 100644 (file)
@@ -12,7 +12,7 @@ REGISTER_WEAPON(SEEKER, w_seeker, IT_ROCKETS, 8, WEP_FLAG_MUTATORBLOCKED | WEP_F
 // ============================
 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);
@@ -223,7 +223,7 @@ void Seeker_Fire_Missile(vector f_diff, entity m_target)
 // ============================
 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);
 
@@ -426,7 +426,7 @@ void Seeker_Tag_Touch()
 
        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)
@@ -495,8 +495,8 @@ void Seeker_Fire_Tag()
        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);
index e7cf23908eda0198025a0c5ebaf437b1eb890757..c79ee95d6e02d2d2062b8a35a987de07f0aca3cb 100644 (file)
@@ -27,7 +27,7 @@ void WarpZone_MakeAllOther();
 #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)