]> de.git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
Merge branch 'master' of git://nl.git.xonotic.org/xonotic/xonotic-data.pk3dir
authorRudolf Polzer <divverent@xonotic.org>
Mon, 6 Jan 2014 09:58:53 +0000 (10:58 +0100)
committerRudolf Polzer <divverent@xonotic.org>
Mon, 6 Jan 2014 09:58:53 +0000 (10:58 +0100)
78 files changed:
balance25.cfg
balanceFruitieX.cfg
balanceXDF.cfg
balanceXPM.cfg
balanceXonotic.cfg
defaultXonotic.cfg
gamemodes.cfg
mutator_new_toys.cfg
qcsrc/client/Main.qc
qcsrc/client/View.qc
qcsrc/client/autocvars.qh
qcsrc/client/bgmscript.qc
qcsrc/client/csqcmodel_hooks.qc
qcsrc/client/hud.qc
qcsrc/client/hud.qh
qcsrc/client/hud_config.qc
qcsrc/client/miscfunctions.qc
qcsrc/client/movetypes.qc
qcsrc/client/particles.qc
qcsrc/client/player_skeleton.qc
qcsrc/client/scoreboard.qc
qcsrc/client/target_music.qc
qcsrc/client/tturrets.qc
qcsrc/client/waypointsprites.qc
qcsrc/common/command/generic.qc
qcsrc/common/constants.qh
qcsrc/common/explosion_equation.qc
qcsrc/common/notifications.qc
qcsrc/common/notifications.qh
qcsrc/common/test.qc
qcsrc/common/urllib.qc
qcsrc/common/util.qc
qcsrc/common/util.qh
qcsrc/csqcmodellib/cl_player.qc
qcsrc/menu/item/label.c
qcsrc/menu/menu.qc
qcsrc/menu/xonotic/serverlist.c
qcsrc/menu/xonotic/slider_decibels.c
qcsrc/menu/xonotic/util.qc
qcsrc/server/accuracy.qc
qcsrc/server/autocvars.qh
qcsrc/server/cheats.qc
qcsrc/server/cl_client.qc
qcsrc/server/cl_impulse.qc
qcsrc/server/cl_weapons.qc
qcsrc/server/cl_weaponsystem.qc
qcsrc/server/command/cmd.qc
qcsrc/server/command/radarmap.qc
qcsrc/server/command/vote.qc
qcsrc/server/defs.qh
qcsrc/server/g_damage.qc
qcsrc/server/g_subs.qc
qcsrc/server/g_tetris.qc
qcsrc/server/g_world.qc
qcsrc/server/miscfunctions.qc
qcsrc/server/mutators/gamemode_assault.qc
qcsrc/server/mutators/gamemode_ca.qc
qcsrc/server/mutators/gamemode_ca.qh
qcsrc/server/mutators/gamemode_freezetag.qc
qcsrc/server/mutators/gamemode_lms.qc
qcsrc/server/scores_rules.qc
qcsrc/server/teamplay.qc
qcsrc/server/tturrets/units/unit_machinegun.qc
qcsrc/server/tturrets/units/unit_walker.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_rifle.qc
qcsrc/server/w_shotgun.qc
qcsrc/server/w_tuba.qc
qcsrc/server/w_uzi.qc
qcsrc/warpzonelib/client.qc
vehicle_raptor.cfg
vehicle_spiderbot.cfg

index 9451d377d99757107948b7e805e8b63c2eeacfdc..f0cc7d73b40baa7681349b3f7943015408f09ef0 100644 (file)
@@ -271,8 +271,7 @@ set g_balance_shotgun_primary_spread 0.07
 set g_balance_shotgun_primary_refire 0.5
 set g_balance_shotgun_primary_animtime 0.2
 set g_balance_shotgun_primary_ammo 1
-set g_balance_shotgun_primary_speed 12000
-set g_balance_shotgun_primary_bulletconstant 75 // 3.8qu
+set g_balance_shotgun_primary_solidpenetration 3.8
 set g_balance_shotgun_secondary 1
 set g_balance_shotgun_secondary_melee_delay 0.25 // 0.35 was too slow
 set g_balance_shotgun_secondary_melee_range 120
@@ -320,8 +319,7 @@ set g_balance_uzi_sustained_spread 0.05
 set g_balance_uzi_sustained_refire 0.1
 set g_balance_uzi_sustained_ammo 1
 
-set g_balance_uzi_speed 18000
-set g_balance_uzi_bulletconstant 115 // 13.1qu
+set g_balance_uzi_solidpenetration 13.1
 
 set g_balance_uzi_switchdelay_drop 0.15
 set g_balance_uzi_switchdelay_raise 0.15
index f985659f9c6549ea4c337004c5804e9d7d83e38b..948d7e4b9eb6de3124259bdd18a4134d3a00c6d6 100644 (file)
@@ -271,8 +271,7 @@ set g_balance_shotgun_primary_spread 0.16 // LOG: changed from 0.18 -> 0.16 to c
 set g_balance_shotgun_primary_refire 1
 set g_balance_shotgun_primary_animtime 0.3
 set g_balance_shotgun_primary_ammo 1
-set g_balance_shotgun_primary_speed 12000
-set g_balance_shotgun_primary_bulletconstant 75 // 3.8qu
+set g_balance_shotgun_primary_solidpenetration 3.8
 set g_balance_shotgun_secondary 1
 set g_balance_shotgun_secondary_melee_delay 0.25 // 0.35 was too slow
 set g_balance_shotgun_secondary_melee_range 120
@@ -320,8 +319,7 @@ set g_balance_uzi_sustained_spread 0.06
 set g_balance_uzi_sustained_refire 0.1
 set g_balance_uzi_sustained_ammo 1
 
-set g_balance_uzi_speed 18000
-set g_balance_uzi_bulletconstant 115 // 13.1qu
+set g_balance_uzi_solidpenetration 13.1
 
 set g_balance_uzi_switchdelay_drop 0.15
 set g_balance_uzi_switchdelay_raise 0.15
index 4e0631523882e1ae1a045afef1598862eeba5ad2..b7d3e02656caf0f73c842e6d1d955aace507d0ce 100644 (file)
@@ -271,8 +271,7 @@ set g_balance_shotgun_primary_spread 0.12
 set g_balance_shotgun_primary_refire 0.75
 set g_balance_shotgun_primary_animtime 0.2
 set g_balance_shotgun_primary_ammo 1
-set g_balance_shotgun_primary_speed 8000
-set g_balance_shotgun_primary_bulletconstant 75 // 3.8qu
+set g_balance_shotgun_primary_solidpenetration 3.8
 set g_balance_shotgun_secondary 1
 set g_balance_shotgun_secondary_melee_delay 0.25 // 0.35 was too slow
 set g_balance_shotgun_secondary_melee_range 120
@@ -320,8 +319,7 @@ set g_balance_uzi_sustained_spread 0
 set g_balance_uzi_sustained_refire 0.1
 set g_balance_uzi_sustained_ammo 1
 
-set g_balance_uzi_speed 18000
-set g_balance_uzi_bulletconstant 115 // 13.1qu
+set g_balance_uzi_solidpenetration 13.1
 
 set g_balance_uzi_switchdelay_drop 0
 set g_balance_uzi_switchdelay_raise 0
index 8c171476a1e126114ea1df373d399fe125741c21..843e16a8357fbeae5fbb5a170919cd4e2f154f0c 100644 (file)
@@ -271,8 +271,7 @@ set g_balance_shotgun_primary_spread 0.12
 set g_balance_shotgun_primary_refire 0.75
 set g_balance_shotgun_primary_animtime 0.2
 set g_balance_shotgun_primary_ammo 1
-set g_balance_shotgun_primary_speed 8000
-set g_balance_shotgun_primary_bulletconstant 75 // 3.8qu
+set g_balance_shotgun_primary_solidpenetration 3.8
 set g_balance_shotgun_secondary 1
 set g_balance_shotgun_secondary_melee_delay 0.25 // 0.35 was too slow
 set g_balance_shotgun_secondary_melee_range 120
@@ -320,8 +319,7 @@ set g_balance_uzi_sustained_spread 0.03
 set g_balance_uzi_sustained_refire 0.1
 set g_balance_uzi_sustained_ammo 1
 
-set g_balance_uzi_speed 18000
-set g_balance_uzi_bulletconstant 115 // 13.1qu
+set g_balance_uzi_solidpenetration 13.1
 
 set g_balance_uzi_switchdelay_drop 0.2
 set g_balance_uzi_switchdelay_raise 0.2
index cdf3f201354aaebeb4351ee1d83f4af9f6d44490..de865fa68087ba37804aeaa36aac0b3f0091d80a 100644 (file)
@@ -271,8 +271,7 @@ set g_balance_shotgun_primary_spread 0.12
 set g_balance_shotgun_primary_refire 0.75
 set g_balance_shotgun_primary_animtime 0.2
 set g_balance_shotgun_primary_ammo 1
-set g_balance_shotgun_primary_speed 8000
-set g_balance_shotgun_primary_bulletconstant 75 // 3.8qu
+set g_balance_shotgun_primary_solidpenetration 3.8
 set g_balance_shotgun_secondary 1
 set g_balance_shotgun_secondary_melee_delay 0.25 // 0.35 was too slow
 set g_balance_shotgun_secondary_melee_range 120
@@ -320,8 +319,7 @@ set g_balance_uzi_sustained_spread 0.03
 set g_balance_uzi_sustained_refire 0.1
 set g_balance_uzi_sustained_ammo 1
 
-set g_balance_uzi_speed 18000
-set g_balance_uzi_bulletconstant 115 // 13.1qu
+set g_balance_uzi_solidpenetration 13.1
 
 set g_balance_uzi_switchdelay_drop 0.2
 set g_balance_uzi_switchdelay_raise 0.2
index 25e2a284be05289cf34171f86f950f4ee90ae66e..2814738e764f9f5a21be5d55d91ffe1584246356 100644 (file)
@@ -141,9 +141,8 @@ set rpn_linear_to_sRGB "dup 1.0 2.4 div pow 1.055 mul 0.055 sub exch 12.92 mul d
 // q3map_skylight 9.32523632 3
 alias skybox_nosRGB_to_sRGB "rpn $3 402.123 $4 div div $rpn_sRGB_to_linear 402.123 $4 div mul /new_skylight: $3 402.123 $4 div div $1 256 div $2 0.017453 mul sin mul add $rpn_sRGB_to_linear $3 402.123 $4 div div $rpn_sRGB_to_linear sub 256 mul $2 0.017453 mul sin div /new_sunlight:"
 
-set cl_orthoview 0 "WARNING: WILL BREAK CONFIG!!! enable top-down view of the map- meant to be used for radar map images"
+set cl_orthoview 0 "enable top-down view of the map- meant to be used for radar map images (note: orthoview sets cvars temporarily, requires restart to return them to normal)"
 set cl_orthoview_nofog 1 "disable fog while in orthoview-- note, should not be enabled on ALL maps, i.e. oilrig works fine with this disabled"
-set cl_orthoview_resolution 512 "resolution accuracy multiplier for deciding fov scaling and view distance"
 
 // these settings determine how much the view is affected by movement/damage
 cl_smoothviewheight 0.05 // time of the averaging to the viewheight value so that it creates a smooth transition for crouching and such. 0 for instant transition
@@ -1193,32 +1192,9 @@ set g_showweaponspawns 1 "display sprites for weapon spawns found on the map whe
 //   Quake-Joule:  1 qJ  = 1 qN * 1 qu
 //   Quake-Pascal: 1 qPa = 1 qN / 1 qu^2
 
-set g_ballistics_materialconstant 1414213562
-set g_ballistics_mindistance 16
+set g_ballistics_mindistance 2 // enable ballistics starting from 2 qu
 set g_ballistics_density_player 0.50 // players are 2x as easy to pass as walls
 set g_ballistics_density_corpse 0.10 // corpses are 10x as easy to pass as walls
-// unit: qJ / qu^3 (energy needed per volume unit of solid to push/burn away
-// parameter: bullet constant: mass / area in g/qu^2
-// = mass / (pi/4 * caliber^2)
-// with caliber in inches, mass in grams:
-// = 1.273239544735163 * mass / caliber^2
-// with caliber in inches, mass in grains:
-// = 0.082633246453312 * mass / caliber^2
-
-// bullet max travel distance inside solid:
-//   0.5 * v^2 * bulletconstant / g_ballistics_materialconstant
-
-// some bullet constants:
-//   http://hypertextbook.com/facts/2000/ShantayArmstrong.shtml
-//     second bullet: caliber .45, mass 16.2g, bullet constant 101.859163578813
-//     third bullet: caliber .338, mass 16.2g, bullet constant 180.5476053421592
-//     fourth bullet: caliber .25, mass 2.3g, bullet constant 46.85521524625399
-//   http://en.wikipedia.org/wiki/.50_BMG
-//     caliber .5, 360 grains, bullet constant 118.9918748927693
-//   AK-47:
-//     caliber .3, 62 grains, bullet constant 56.92512533450383
-//   .3 winchester magnum:
-//     caliber .3, 150 grains, bullet constant 137.7220774221867
 
 set cl_stripcolorcodes 0       "experimental feature (notes: strips ALL color codes from messages!)"
 
index feed7488b5c2681d4e78565c600d6cf69a2350e0..b5b460fe3a489759f62dd6603ac8008f4ba1f91b 100644 (file)
@@ -144,8 +144,9 @@ set g_ca_point_leadlimit 0
 set g_ca_spectate_enemies 0 "Allow spectating enemy player by dead player during clan arena games."
 set g_ca_warmup 10 "how long the players will have time to run around the map before the round starts"
 set g_ca_damage2score_multiplier 0.01
-set g_ca_round_timelimit 180
+set g_ca_round_timelimit 180 "round time limit in seconds"
 seta g_ca_teams_override 0
+set g_ca_team_spawns 0 "when 1, players spawn from the team spawnpoints of the map, if any"
 set g_ca_teams 0
 
 
@@ -231,7 +232,7 @@ set g_cts_finish_kill_delay 10 "prevent cheating by running back to the start li
 // ==========================
 set g_dm 1 "Deathmatch: killing any other player is one frag, player with most frags wins"
 set g_tdm_teams 2 "how many teams are in team deathmatch (set by mapinfo)"
-set g_tdm_team_spawns 0 "when 1, a map can define team spawnpoints for TDM"
+set g_tdm_team_spawns 0 "when 1, players spawn from the team spawnpoints of the map, if any"
 seta g_tdm_teams_override 0    "how many teams are in team deathmatch"
 
 
@@ -262,10 +263,11 @@ set g_freezetag_revive_clearspeed 1.6 "Speed at which reviving progress gets los
 set g_freezetag_revive_extra_size 100 "Distance in qu that you can stand from a frozen teammate to keep reviving him"
 set g_freezetag_revive_falldamage 0 "Enable reviving from this amount of fall damage"
 set g_freezetag_revive_falldamage_health 40 "Amount of health player has if they revived from falling"
-set g_freezetag_round_timelimit 180
+set g_freezetag_round_timelimit 180 "round time limit in seconds"
 set g_freezetag_frozen_force 0.6 "How much to multiply the force on a frozen player with"
 set g_freezetag_frozen_maxtime 60 "frozen players will be automatically unfrozen after this time in seconds"
 seta g_freezetag_teams_override 0
+set g_freezetag_team_spawns 0 "when 1, players spawn from the team spawnpoints of the map, if any"
 set g_freezetag_teams 0
 
 
index 327cdd1a2aa2029548b651bc4daf28548bf6fe7c..9835f41ddbcf157823668587d557f82359cdeb23 100644 (file)
@@ -84,12 +84,10 @@ set g_balance_rifle_primary_shots 1
 set g_balance_rifle_primary_damage 80
 set g_balance_rifle_primary_spread 0
 set g_balance_rifle_primary_force 100
-set g_balance_rifle_primary_speed 40000
-set g_balance_rifle_primary_lifetime 5
 set g_balance_rifle_primary_refire 1.2
 set g_balance_rifle_primary_animtime 0.4
 set g_balance_rifle_primary_ammo 10
-set g_balance_rifle_primary_bulletconstant 110 // 62.2qu
+set g_balance_rifle_primary_solidpenetration 62.2
 set g_balance_rifle_primary_burstcost 0
 set g_balance_rifle_primary_bullethail 0 // empty magazine on shot
 set g_balance_rifle_secondary 1
@@ -99,12 +97,10 @@ set g_balance_rifle_secondary_shots 4
 set g_balance_rifle_secondary_damage 20
 set g_balance_rifle_secondary_spread 0.04
 set g_balance_rifle_secondary_force 50
-set g_balance_rifle_secondary_speed 20000
-set g_balance_rifle_secondary_lifetime 5
 set g_balance_rifle_secondary_refire 0.9
 set g_balance_rifle_secondary_animtime 0.3
 set g_balance_rifle_secondary_ammo 10
-set g_balance_rifle_secondary_bulletconstant 110 // 15.5qu
+set g_balance_rifle_secondary_solidpenetration 15.5
 set g_balance_rifle_secondary_burstcost 0
 set g_balance_rifle_secondary_bullethail 0 // empty magazine on shot
 set g_balance_rifle_switchdelay_drop 0.2
index f43f2da29d6fe04af5ad1ce2d76bd59de03616c6..3206e923c37bd2a1d284bb337db11420905cbac8 100644 (file)
@@ -53,7 +53,7 @@ void CSQC_Init(void)
        check_unacceptable_compiler_bugs();
 
 #ifdef WATERMARK
-       print(sprintf(_("^4CSQC Build information: ^1%s\n"), WATERMARK));
+       printf(_("^4CSQC Build information: ^1%s\n"), WATERMARK);
 #endif
 
        float i;
@@ -213,7 +213,7 @@ float SetTeam(entity o, float Team)
                        default:
                                if(GetTeam(Team, false) == world)
                                {
-                                       print(sprintf(_("trying to switch to unsupported team %d\n"), Team));
+                                       printf(_("trying to switch to unsupported team %d\n"), Team);
                                        Team = NUM_SPECTATOR;
                                }
                                break;
@@ -229,7 +229,7 @@ float SetTeam(entity o, float Team)
                        default:
                                if(GetTeam(Team, false) == world)
                                {
-                                       print(sprintf(_("trying to switch to unsupported team %d\n"), Team));
+                                       printf(_("trying to switch to unsupported team %d\n"), Team);
                                        Team = NUM_SPECTATOR;
                                }
                                break;
@@ -424,7 +424,7 @@ void Ent_ReadPlayerScore()
        if(!isNew && n != self.sv_entnum)
        {
                //print("A CSQC entity changed its owner!\n");
-               print(sprintf("A CSQC entity changed its owner! (edict: %d, classname: %s)\n", num_for_edict(self), self.classname));
+               printf("A CSQC entity changed its owner! (edict: %d, classname: %s)\n", num_for_edict(self), self.classname);
                isNew = true;
                Ent_Remove();
                self.enttype = ENT_CLIENT_SCORES;
@@ -687,7 +687,7 @@ void Ent_ReadSpawnPoint(float is_new) // entity for spawnpoint
                }
        }
 
-       //print(sprintf("Ent_ReadSpawnPoint(is_new = %d); origin = %s, team = %d, effect = %d\n", is_new, vtos(self.origin), teamnum, self.cnt));
+       //printf("Ent_ReadSpawnPoint(is_new = %d); origin = %s, team = %d, effect = %d\n", is_new, vtos(self.origin), teamnum, self.cnt);
 }
 
 void Ent_ReadSpawnEvent(float is_new)
@@ -738,7 +738,7 @@ void Ent_ReadSpawnEvent(float is_new)
                }
        }
 
-       //print(sprintf("Ent_ReadSpawnEvent(is_new = %d); origin = %s, entnum = %d, localentnum = %d\n", is_new, vtos(self.origin), entnum, player_localentnum));
+       //printf("Ent_ReadSpawnEvent(is_new = %d); origin = %s, entnum = %d, localentnum = %d\n", is_new, vtos(self.origin), entnum, player_localentnum);
 }
 
 // CSQC_Ent_Update : Called every frame that the server has indicated an update to the SSQC / CSQC entity has occured.
@@ -753,7 +753,7 @@ void CSQC_Ent_Update(float bIsNewEntity)
        t = ReadByte();
 
        if(autocvar_developer_csqcentities)
-               print(sprintf("CSQC_Ent_Update(%d) with self=%i self.entnum=%d self.enttype=%d t=%d\n", bIsNewEntity, self, self.entnum, self.enttype, t));
+               printf("CSQC_Ent_Update(%d) with self=%i self.entnum=%d self.enttype=%d t=%d\n", bIsNewEntity, self, self.entnum, self.enttype, t);
 
        // set up the "time" global for received entities to be correct for interpolation purposes
        savetime = time;
@@ -774,7 +774,7 @@ void CSQC_Ent_Update(float bIsNewEntity)
                if(t != self.enttype || bIsNewEntity)
                {
                        //print("A CSQC entity changed its type!\n");
-                       print(sprintf("A CSQC entity changed its type! (edict: %d, server: %d, type: %d -> %d)\n", num_for_edict(self), self.entnum, self.enttype, t));
+                       printf("A CSQC entity changed its type! (edict: %d, server: %d, type: %d -> %d)\n", num_for_edict(self), self.entnum, self.enttype, t);
                        Ent_Remove();
                        clearentity(self);
                        bIsNewEntity = 1;
@@ -784,7 +784,7 @@ void CSQC_Ent_Update(float bIsNewEntity)
        {
                if(!bIsNewEntity)
                {
-                       print(sprintf("A CSQC entity appeared out of nowhere! (edict: %d, server: %d, type: %d)\n", num_for_edict(self), self.entnum, t));
+                       printf("A CSQC entity appeared out of nowhere! (edict: %d, server: %d, type: %d)\n", num_for_edict(self), self.entnum, t);
                        bIsNewEntity = 1;
                }
        }
@@ -868,7 +868,7 @@ void Ent_Remove()
 void CSQC_Ent_Remove()
 {
        if(autocvar_developer_csqcentities)
-               print(sprintf("CSQC_Ent_Remove() with self=%i self.entnum=%d self.enttype=%d\n", self, self.entnum, self.enttype));
+               printf("CSQC_Ent_Remove() with self=%i self.entnum=%d self.enttype=%d\n", self, self.entnum, self.enttype);
 
        if(wasfreed(self))
        {
@@ -893,7 +893,7 @@ void Gamemode_Init()
 void CSQC_Parse_StuffCmd(string strMessage)
 {
        if(autocvar_developer_csqcentities)
-               print(sprintf("CSQC_Parse_StuffCmd(\"%s\")\n", strMessage));
+               printf("CSQC_Parse_StuffCmd(\"%s\")\n", strMessage);
 
        localcmd(strMessage);
 }
@@ -901,7 +901,7 @@ void CSQC_Parse_StuffCmd(string strMessage)
 void CSQC_Parse_Print(string strMessage)
 {
        if(autocvar_developer_csqcentities)
-               print(sprintf("CSQC_Parse_Print(\"%s\")\n", strMessage));
+               printf("CSQC_Parse_Print(\"%s\")\n", strMessage);
 
        print(ColorTranslateRGB(strMessage));
 }
@@ -910,7 +910,7 @@ void CSQC_Parse_Print(string strMessage)
 void CSQC_Parse_CenterPrint(string strMessage)
 {
        if(autocvar_developer_csqcentities)
-               print(sprintf("CSQC_Parse_CenterPrint(\"%s\")\n", strMessage));
+               printf("CSQC_Parse_CenterPrint(\"%s\")\n", strMessage);
 
        centerprint_hud(strMessage);
 }
@@ -1201,7 +1201,7 @@ float CSQC_Parse_TempEntity()
                nTEID = ReadByte();
 
        if(autocvar_developer_csqcentities)
-               print(sprintf("CSQC_Parse_TempEntity() with nTEID=%d\n", nTEID));
+               printf("CSQC_Parse_TempEntity() with nTEID=%d\n", nTEID);
 
                // NOTE: Could just do return instead of break...
        switch(nTEID)
@@ -1218,10 +1218,6 @@ float CSQC_Parse_TempEntity()
                        Net_ReadRace();
                        bHandled = true;
                        break;
-               case TE_CSQC_ZCURVEPARTICLES:
-                       Net_ReadZCurveParticles();
-                       bHandled = true;
-                       break;
                case TE_CSQC_NEXGUNBEAMPARTICLE:
                        Net_ReadNexgunBeamParticle();
                        bHandled = true;
index 493907a8783a1d37b0e9d37f09412207937892b9..41cec30bf011b78d3c8968f714c3b206523070a3 100644 (file)
@@ -572,7 +572,7 @@ void CSQC_UpdateView(float w, float h)
 
                float ov_width = (ov_worldmax_x - ov_worldmin_x);
                float ov_height = (ov_worldmax_y - ov_worldmin_y);
-               float ov_distance = (autocvar_cl_orthoview_resolution * max(ov_width, ov_height));
+               float ov_distance = (max(vid_width, vid_height) * max(ov_width, ov_height));
 
                ov_mid = ((ov_worldmax + ov_worldmin) * 0.5);
                ov_org = vec3(ov_mid_x, ov_mid_y, (ov_mid_z + ov_distance));
@@ -595,23 +595,23 @@ void CSQC_UpdateView(float w, float h)
                if((dist = vlen(vec3(ov_worldmax_x, ov_worldmin_y, ov_worldmax_z) - ov_org)) > ov_furthest) { ov_furthest = dist; }
                if((dist = vlen(vec3(ov_worldmax_x, ov_worldmax_y, ov_worldmax_z) - ov_org)) > ov_furthest) { ov_furthest = dist; }
 
-               cvar_set("r_nearclip", ftos(ov_nearest));
-               cvar_set("r_farclip_base", ftos(ov_furthest));
-               cvar_set("r_farclip_world", "0");
-               cvar_set("r_novis", "1");
-               cvar_set("r_useportalculling", "0");
-               cvar_set("r_useinfinitefarclip", "0");
+               cvar_settemp("r_nearclip", ftos(ov_nearest));
+               cvar_settemp("r_farclip_base", ftos(ov_furthest));
+               cvar_settemp("r_farclip_world", "0");
+               cvar_settemp("r_novis", "1");
+               cvar_settemp("r_useportalculling", "0");
+               cvar_settemp("r_useinfinitefarclip", "0");
 
                setproperty(VF_ORIGIN, ov_org);
                setproperty(VF_ANGLES, '90 0 0');
 
                #if 0
-               print(sprintf("OrthoView: org = %s, angles = %s, distance = %f, nearest = %f, furthest = %f\n",
+               printf("OrthoView: org = %s, angles = %s, distance = %f, nearest = %f, furthest = %f\n",
                        vtos(ov_org),
                        vtos(getpropertyvec(VF_ANGLES)),
                        ov_distance,
                        ov_nearest,
-                       ov_furthest));
+                       ov_furthest);
                #endif
        }
 
@@ -1238,7 +1238,7 @@ void CSQC_UpdateView(float w, float h)
                                }
                        }
 
-                       //print(sprintf("crosshair style: %s\n", wcross_style));
+                       //printf("crosshair style: %s\n", wcross_style);
                        wcross_name = strcat("gfx/crosshair", wcross_style);
 
                        // MAIN CROSSHAIR COLOR DECISION
index 16c5fc76a8308eb3e122843cabcd11fdd3627e4e..43aab6ae44c73f3c2b0c598bbe4ae3d72014248e 100644 (file)
@@ -56,7 +56,6 @@ float autocvar_cl_lockview;
 float autocvar_cl_nogibs;
 float autocvar_cl_orthoview;
 float autocvar_cl_orthoview_nofog;
-float autocvar_cl_orthoview_resolution;
 float autocvar_cl_particlegibs;
 float autocvar_cl_particles_oldnexbeam;
 float autocvar_cl_particles_quality;
index fda38b125c6cc5780458ded23b7761e027400ba8..9d024941e6bf00d4b8c7f53133deca7535edbde4 100644 (file)
@@ -131,7 +131,7 @@ void BGMScript_InitEntity(entity e)
                e.bgmscriptline = e.bgmscriptline0 = i;
                if(i >= bgmscriptbufsize)
                {
-                       print(sprintf("ERROR: bgmscript does not define %s\n", e.bgmscript));
+                       printf("ERROR: bgmscript does not define %s\n", e.bgmscript);
                        strunzone(e.bgmscript);
                        e.bgmscript = string_null;
                }
index fb87f9a7456e07a772c6f05bbbcc4d0b79a3526a..6f008fb541a118c53c2a10cf0513d64fffe61dd9 100644 (file)
@@ -114,7 +114,7 @@ void CSQCPlayer_ModelAppearance_PostUpdate(void)
                self.forceplayermodels_isgoodmodel = fexists(self.forceplayermodels_savemodel);
                self.forceplayermodels_isgoodmodel_mdl = self.forceplayermodels_savemodel;
                if(!self.forceplayermodels_isgoodmodel)
-                       print(sprintf("Warning: missing model %s has been used\n", self.forceplayermodels_savemodel));
+                       printf("Warning: missing model %s has been used\n", self.forceplayermodels_savemodel);
        }
 }
 void CSQCPlayer_ModelAppearance_Apply(float islocalplayer)
@@ -292,7 +292,7 @@ void CSQCPlayer_ModelAppearance_Apply(float islocalplayer)
                else if(self.old_glowmod != '0 0 0') { self.old_glowmod = '0 0 0'; }
        }
 
-       //print(sprintf("CSQCPlayer_ModelAppearance_Apply(): state = %s, colormap = %f, glowmod = %s\n", (self.csqcmodel_isdead ? "DEAD" : "ALIVE"), self.colormap, vtos(self.glowmod)));
+       //printf("CSQCPlayer_ModelAppearance_Apply(): state = %s, colormap = %f, glowmod = %s\n", (self.csqcmodel_isdead ? "DEAD" : "ALIVE"), self.colormap, vtos(self.glowmod));
 }
 
 // FEATURE: fallback frames
@@ -362,7 +362,7 @@ float CSQCPlayer_FallbackFrame(float f)
                case 29: return 4; // anim_duckwalkbackright -> anim_duckwalk
                case 30: return 4; // anim_duckwalkbackleft -> anim_duckwalk
        }
-       print(sprintf("Frame %d missing in model %s, and we have no fallback - FAIL!\n", f, self.model));
+       printf("Frame %d missing in model %s, and we have no fallback - FAIL!\n", f, self.model);
        return f;
 }
 void CSQCPlayer_FallbackFrame_Apply(void)
index 0bc5ed0f80beb412cd563cd10901abc266ddb116..252142506f88731b28e21e679c0bd5d84b7d52b2 100644 (file)
@@ -4095,7 +4095,7 @@ float centerprint_showing;
 
 void centerprint_generic(float new_id, string strMessage, float duration, float countdown_num)
 {
-       //print(sprintf("centerprint_generic(%d, '%s^7', %d, %d);\n", new_id, strMessage, duration, countdown_num));
+       //printf("centerprint_generic(%d, '%s^7', %d, %d);\n", new_id, strMessage, duration, countdown_num);
        float i, j;
 
        if(strMessage == "" && new_id == 0)
@@ -4261,8 +4261,7 @@ void HUD_CenterPrint (void)
        float a, sz, align, current_msg_pos_y = 0, msg_size;
        vector pos;
        string ts;
-
-       n = -1; // if no msg will be displayed, n stays -1
+       float all_messages_expired = TRUE;
 
        pos = panel_pos;
        if (autocvar_hud_panel_centerprint_flip)
@@ -4285,6 +4284,7 @@ void HUD_CenterPrint (void)
                                continue;
                }
 
+               all_messages_expired = FALSE;
 
                // fade the centerprint_hud in/out
                if(centerprint_time[j] < 0)  // Expired but forced. Expire time is the fade-in time.
@@ -4294,7 +4294,7 @@ void HUD_CenterPrint (void)
                else // Expiring soon, so fade it out.
                        a = (centerprint_expire_time[j] - time) / max(0.0001, autocvar_hud_panel_centerprint_fade_out);
 
-               if (a <= 0.5/256.0)  // Guaranteed invisible - don't show.
+               if (a <= 0.5/255.0)  // Guaranteed invisible - don't show.
                        continue;
                if (a > 1)
                        a = 1;
@@ -4348,7 +4348,7 @@ void HUD_CenterPrint (void)
                                {
                                        if (align)
                                                pos_x = panel_pos_x + (panel_size_x - stringwidth(ts, TRUE, fontsize)) * align;
-                                       if (a > 0.5/256.0)  // Otherwise guaranteed invisible - don't show. This is checked a second time after some multiplications with other factors were done so temporary changes of these cannot cause flicker.
+                                       if (a > 0.5/255.0)  // Otherwise guaranteed invisible - don't show. This is checked a second time after some multiplications with other factors were done so temporary changes of these cannot cause flicker.
                                                drawcolorcodedstring(pos + eY * 0.5 * (1 - sz) * fontsize_y, ts, fontsize, a, DRAWFLAG_NORMAL);
                                        pos_y += fontsize_y;
                                }
@@ -4386,7 +4386,7 @@ void HUD_CenterPrint (void)
                }
        }
        drawfontscale = '1 1 0';
-       if (n == -1)
+       if (all_messages_expired)
        {
                centerprint_showing = FALSE;
                reset_centerprint_messages();
index 1fe76b091cc2239684a1a420d1e5ee95108b8a8e..c2432b97c78191d5d8b38304cf14c414bf66b707 100644 (file)
@@ -344,7 +344,7 @@ if(panel.update_time <= time) { \
                strunzone(panel.current_panel_bg); \
        if(panel_bg == "")\
        {\
-               /*print(sprintf("^xf08 %s panel: panel_bg is empty\n", panel.panel_name));*/\
+               /*printf("^xf08 %s panel: panel_bg is empty\n", panel.panel_name);*/\
                panel_bg = "0";\
        }\
        panel.current_panel_bg = strzone(panel_bg); \
@@ -361,7 +361,7 @@ if(panel.update_time <= time) { \
        panel_bg = panel.current_panel_bg; \
        if(panel.current_panel_bg == "")\
        {\
-               /*print(sprintf("^xf08 %s panel: panel.current_panel_bg is empty\n", panel.panel_name));*/\
+               /*printf("^xf08 %s panel: panel.current_panel_bg is empty\n", panel.panel_name);*/\
                panel_bg = "0";\
        }\
        panel_bg_alpha = panel.current_panel_bg_alpha; \
index 869e30dda0d782f593b9a95e8b60cd371dd94048..d361454843feea745f877ba898872a4dd2ea467a 100644 (file)
@@ -193,11 +193,11 @@ void HUD_Panel_ExportCfg(string cfgname)
                }
                HUD_Write("menu_sync\n"); // force the menu to reread the cvars, so that the dialogs are updated
 
-               print(sprintf(_("^2Successfully exported to %s! (Note: It's saved in data/data/)\n"), filename));
+               printf(_("^2Successfully exported to %s! (Note: It's saved in data/data/)\n"), filename);
                fclose(fh);
        }
        else
-               print(sprintf(_("^1Couldn't write to %s\n"), filename));
+               printf(_("^1Couldn't write to %s\n"), filename);
 }
 
 void HUD_Configure_Exit_Force()
index b1dcce0ee25d3cdbe6370dd9349fdfbdb29be2e1..61e527cf1fbc69ade54b71368eb0e0c6fa563ab7 100644 (file)
@@ -612,7 +612,7 @@ void URI_Get_Callback(float id, float status, string data)
        }
        else
        {
-               print(sprintf("Received HTTP request data for an invalid id %d.\n", id));
+               printf("Received HTTP request data for an invalid id %d.\n", id);
        }
 }
 
index 22bbd142f90871ad4d8c906eda836d489dca761d..402e44cac83210d5a10485cfbf47845f9bbde998 100644 (file)
@@ -160,10 +160,10 @@ float _Movetype_UnstickEntity() // SV_UnstickEntity
                if(!_Movetype_TestEntityPosition('0 0 -1' * i)) goto success;
                if(!_Movetype_TestEntityPosition('0 0 1' * i)) goto success;
        }
-       dprint(sprintf(_("Can't unstick an entity (edict: %d, classname: %s, origin: %s)\n"), num_for_edict(self), self.classname, vtos(self.move_origin)));
+       dprintf(_("Can't unstick an entity (edict: %d, classname: %s, origin: %s)\n"), num_for_edict(self), self.classname, vtos(self.move_origin));
        return FALSE;
 :success
-       dprint(sprintf(_("Sucessfully unstuck an entity (edict: %d, classname: %s, origin: %s)\n"), num_for_edict(self), self.classname, vtos(self.move_origin)));
+       dprintf(_("Sucessfully unstuck an entity (edict: %d, classname: %s, origin: %s)\n"), num_for_edict(self), self.classname, vtos(self.move_origin));
        _Movetype_LinkEdict(TRUE);
        return TRUE;
 }
index ce8b6dd7f9ecbe612a0aeb52d87650633d6228e7..8751cc0c5535c107d2e4de8b43d2f033c232e408 100644 (file)
@@ -225,64 +225,6 @@ void Ent_RainOrSnow()
                self.draw = Draw_Snow;
 }
 
-entity zcurve;
-void zcurveparticles(float effectnum, vector start, vector end, float end_dz, float speed, float depth)
-{
-       // end_dz:
-       //   IF IT WERE A STRAIGHT LINE, it'd end end_dz above end
-
-       vector mid;
-       mid = (start + end) * 0.5;
-
-       end_dz *= 0.25;
-       mid_z += end_dz;
-
-       --depth;
-       if(depth < 0 || normalize(mid - start) * normalize(end - start) > 0.999999)
-       // TODO make this a variable threshold
-       // currently: 0.081 degrees
-       // 0.99999 would be 0.256 degrees and is visible
-       {
-               zcurve.velocity = speed * normalize(end - start);
-               trailparticles(zcurve, effectnum, start, end);
-       }
-       else
-       {
-               zcurveparticles(effectnum, start, mid, end_dz, speed, depth);
-               zcurveparticles(effectnum, mid, end, end_dz, speed, depth);
-       }
-}
-
-void Net_ReadZCurveParticles()
-{
-       vector start, end;
-       float end_dz;
-       float effectnum, speed;
-
-       if(!zcurve)
-       {
-               zcurve = spawn();
-               zcurve.classname = "zcurve";
-       }
-
-       effectnum = ReadShort();
-
-       start_x = ReadCoord();
-       start_y = ReadCoord();
-       start_z = ReadCoord();
-
-       do
-       {
-               end_x = ReadCoord();
-               end_y = ReadCoord();
-               end_z = ReadCoord();
-               end_dz = ReadCoord();
-               speed = ReadShort();
-               zcurveparticles(effectnum, start, end, end_dz, 16 * (speed & 0x7FFF), 5); // at most 32 segments
-       }
-       while(!(speed & 0x8000));
-}
-
 void Net_ReadNexgunBeamParticle()
 {
        vector shotorg, endpos;
index 7784fc1f693fe2bb54674220bb47c4ace5f57162..ad5e23aa88335e382a221201828870ad848af471 100644 (file)
@@ -84,8 +84,8 @@ void skel_set_boneabs(float s, float bone, vector absorg)
 
        /*
        vector neworg = skel_get_boneabs(s, bone);
-       print(sprintf("ANG: want: %v, got: %v\n", absang, fixedvectoangles2(v_forward, v_up)));
-       print(sprintf("ORG: want: %v, got: %v\n", absorg, neworg));
+       printf("ANG: want: %v, got: %v\n", absang, fixedvectoangles2(v_forward, v_up));
+       printf("ORG: want: %v, got: %v\n", absorg, neworg);
        */
 }
 
@@ -150,8 +150,8 @@ void skeleton_from_frames(entity e, float is_dead)
                        e.lerpfrac3 = 0;
                        e.lerpfrac4 = savelerpfrac4 * 2;
                }
-               //print(sprintf("Run: bone %d to %d, type %d\n", firstbone + 1, bone, bonetype));
-               //print(sprintf("frame %d %d %d %d lerpfrac * %d %d %d\n", e.frame, e.frame2, e.frame3, e.frame4, e.lerpfrac, e.lerpfrac3, e.lerpfrac4));
+               //printf("Run: bone %d to %d, type %d\n", firstbone + 1, bone, bonetype);
+               //printf("frame %d %d %d %d lerpfrac * %d %d %d\n", e.frame, e.frame2, e.frame3, e.frame4, e.lerpfrac, e.lerpfrac3, e.lerpfrac4);
                skel_build(s, e, m, 0, firstbone + 1, bone);
        }
        e.lerpfrac = savelerpfrac;
index b037d03d20cb35a4431315f87bc6ade863153b8b..8a7d3fd49fd8976d83dc2651cfc0ad5bce69e749 100644 (file)
@@ -410,7 +410,7 @@ void Cmd_HUD_SetFields(float argc)
                        else
                        {
                                if (!nocomplain)
-                                       print(sprintf("^1Error:^7 Unknown score field: '%s'\n", str));
+                                       printf("^1Error:^7 Unknown score field: '%s'\n", str);
                                continue;
                        }
 :found
@@ -481,7 +481,7 @@ void Cmd_HUD_SetFields(float argc)
                        hud_size[hud_num_fields] = stringwidth(hud_title[hud_num_fields], FALSE, hud_fontsize);
                        hud_field[hud_num_fields] = ps_secondary;
                        ++hud_num_fields;
-                       print(sprintf("fixed missing field '%s'\n", scores_label[ps_secondary]));
+                       printf("fixed missing field '%s'\n", scores_label[ps_secondary]);
                }
                if(!have_primary)
                {
@@ -490,7 +490,7 @@ void Cmd_HUD_SetFields(float argc)
                        hud_size[hud_num_fields] = stringwidth(hud_title[hud_num_fields], FALSE, hud_fontsize);
                        hud_field[hud_num_fields] = ps_primary;
                        ++hud_num_fields;
-                       print(sprintf("fixed missing field '%s'\n", scores_label[ps_primary]));
+                       printf("fixed missing field '%s'\n", scores_label[ps_primary]);
                }
        }
 
index f30e77af424007e8aebd4d8805c1fea2e19359f8..fa116dc731625ccc8e99afba627bd59049681004 100644 (file)
@@ -91,7 +91,7 @@ void Net_TargetMusic()
                sound(e, CH_BGM_SINGLE, e.noise, 0, ATTEN_NONE);
                if(getsoundtime(e, CH_BGM_SINGLE) < 0)
                {
-                       print(sprintf(_("Cannot initialize sound %s\n"), e.noise));
+                       printf(_("Cannot initialize sound %s\n"), e.noise);
                        strunzone(e.noise);
                        e.noise = string_null;
                }
@@ -180,7 +180,7 @@ void Ent_ReadTriggerMusic()
                        sound(self, CH_BGM_SINGLE, self.noise, 0, ATTEN_NONE);
                        if(getsoundtime(self, CH_BGM_SINGLE) < 0)
                        {
-                               print(sprintf(_("Cannot initialize sound %s\n"), self.noise));
+                               printf(_("Cannot initialize sound %s\n"), self.noise);
                                strunzone(self.noise);
                                self.noise = string_null;
                        }
index 2088348b17527dd50317c5a464a4afa6896415a0..ba640068ef82e7db0495d4b23d0a06850da215de 100644 (file)
@@ -291,7 +291,7 @@ void turret_draw2d()
        if(rgb == '0 0 0')
        {
                self.teamradar_color = '1 0 1';
-               print(sprintf("WARNING: sprite of name %s has no color, using pink so you notice it\n", spriteimage));
+               printf("WARNING: sprite of name %s has no color, using pink so you notice it\n", spriteimage);
        }
 
        txt = self.netname;
index a3e856d1438197df091be171493946c75273a1c5..cde516b623dd0bbeafb6dd5b10c8382c5c491b81 100644 (file)
@@ -457,7 +457,7 @@ void Draw_WaypointSprite()
        if(rgb == '0 0 0')
        {
                self.teamradar_color = '1 0 1';
-               print(sprintf("WARNING: sprite of name %s has no color, using pink so you notice it\n", spriteimage));
+               printf("WARNING: sprite of name %s has no color, using pink so you notice it\n", spriteimage);
        }
 
        if(time - floor(time) > 0.5)
index 5e8accbd2912ece956d6e9bc36cb1e0092b03afd..08b0b69ddffcedd8b52840e40aa601d739d990cb 100644 (file)
@@ -28,7 +28,7 @@ void Curl_URI_Get_Callback(float id, float status, string data)
        do_cvar = curl_uri_get_cvar[i];
        if(status != 0)
        {
-               print(sprintf(_("error: status is %d\n"), status));
+               printf(_("error: status is %d\n"), status);
                if(do_cvar)
                        strunzone(do_cvar);
                return;
@@ -252,12 +252,12 @@ void GenericCommand_dumpnotifs(float request)
                        if(fh >= 0)
                        {
                                Dump_Notifications(fh, alsoprint);
-                               print(sprintf("Dumping notifications... File located in ^2data/data/%s^7.\n", filename));
+                               printf("Dumping notifications... File located in ^2data/data/%s^7.\n", filename);
                                fclose(fh);
                        }
                        else
                        {
-                               print(sprintf("^1Error: ^7Could not open file '%s'!\n", filename));
+                               printf("^1Error: ^7Could not open file '%s'!\n", filename);
                        }
                        #else
                        print(_("Notification dump command only works with cl_cmd and sv_cmd.\n"));
@@ -433,7 +433,7 @@ void GenericCommand_restartnotifs(float request)
                case CMD_REQUEST_COMMAND:
                {
                        #ifndef MENUQC
-                       print(sprintf(
+                       printf(
                                strcat(
                                        "Restart_Notifications(): Restarting %d notifications... ",
                                        "Counts: MSG_ANNCE = %d, MSG_INFO = %d, MSG_CENTER = %d, MSG_MULTI = %d, MSG_CHOICE = %d\n"
@@ -450,7 +450,7 @@ void GenericCommand_restartnotifs(float request)
                                NOTIF_CENTER_COUNT,
                                NOTIF_MULTI_COUNT,
                                NOTIF_CHOICE_COUNT
-                       ));
+                       );
                        Destroy_All_Notifications();
                        CALL_ACCUMULATED_FUNCTION(RegisterNotifications);
                        #else
index 55d16953f6a04d4a5e4f9bc8c289b5981654704e..8ae465e54dab91f32187850029b5ffdd0fde0797 100644 (file)
@@ -30,7 +30,6 @@ const float AS_FLOAT = 8;
 
 const float TE_CSQC_PICTURE = 100;
 const float TE_CSQC_RACE = 101;
-const float TE_CSQC_ZCURVEPARTICLES = 102;
 const float TE_CSQC_NEXGUNBEAMPARTICLE = 103;
 const float TE_CSQC_LIGHTNINGARC = 104;
 const float TE_CSQC_TEAMNAGGER = 105;
index df71154be885faea83287a56d6a131da2746ca21..3fddd70d23187131d433c72d00bbe87691bc5887 100644 (file)
@@ -51,11 +51,11 @@ vector damage_explosion_calcpush(vector explosion_f, vector target_v, float spee
        v = explosion_calcpush(explosion_f * speedfactor, m, target_v, 1, 0);
        // the factor we then get is:
        //   1
-       print(sprintf("MASS: %f\nv: %v -> %v\nENERGY BEFORE == %f + %f = %f\nENERGY AFTER >= %f\n",
+       printf("MASS: %f\nv: %v -> %v\nENERGY BEFORE == %f + %f = %f\nENERGY AFTER >= %f\n",
                m,
                target_v, target_v + v,
                target_v * target_v, m * explosion_f * speedfactor * explosion_f * speedfactor, target_v * target_v + m * explosion_f * speedfactor * explosion_f * speedfactor,
-               (target_v + v) * (target_v + v)));
+               (target_v + v) * (target_v + v));
        return v;
 #endif
        return explosion_f * explosion_calcpush_getmultiplier(explosion_f * speedfactor, target_v);
index 8c297513e72e4f97ac85a42ffa24a5043498ea93..4fd6e1f25dcc37373a00a04a565aec114867ddb2 100644 (file)
@@ -281,7 +281,7 @@ string Process_Notif_Line(
        // done to both MSG_INFO and MSG_CENTER
        if(substring(input, (strlen(input) - 1), 1) == "\n")
        {
-               print(sprintf(
+               printf(
                        strcat(
                                "^1TRAILING NEW LINE AT END OF NOTIFICATION: ",
                                "^7net_type = %s, net_name = %s, string = %s.\n"
@@ -289,7 +289,7 @@ string Process_Notif_Line(
                        notiftype,
                        notifname,
                        stringtype
-               ));
+               );
                notif_error = TRUE;
                input = substring(input, 1, (strlen(input) - 1));
        }
@@ -316,7 +316,7 @@ string Process_Notif_Args(
                        {
                                if(sel_num == NOTIF_MAX_ARGS)
                                {
-                                       print(sprintf(
+                                       printf(
                                                strcat(
                                                        "^1NOTIFICATION HAS TOO MANY ARGUMENTS: ",
                                                        "^7net_type = %s, net_name = %s, max args = %d.\n"
@@ -324,7 +324,7 @@ string Process_Notif_Args(
                                                notiftype,
                                                notifname,
                                                NOTIF_MAX_ARGS
-                                       ));
+                                       );
                                        notif_error = TRUE;
                                        break;
                                }
@@ -348,7 +348,7 @@ string Process_Notif_Args(
                                        #undef ARG_CASE_ARG_CS_SV_HA
                                        default:
                                        {
-                                               print(sprintf(
+                                               printf(
                                                        strcat(
                                                                "^1NOTIFICATION WITH UNKNOWN TOKEN IN ARGUMENT STRING: ",
                                                                "^7net_type = %s, net_name = %s, args arg = '%s'.\n"
@@ -356,7 +356,7 @@ string Process_Notif_Args(
                                                        notiftype,
                                                        notifname,
                                                        selected
-                                               ));
+                                               );
                                                notif_error = TRUE;
                                                break;
                                        }
@@ -367,7 +367,7 @@ string Process_Notif_Args(
                        {
                                if(sel_num == NOTIF_MAX_HUDARGS)
                                {
-                                       print(sprintf(
+                                       printf(
                                                strcat(
                                                        "^1NOTIFICATION HAS TOO MANY ARGUMENTS: ",
                                                        "^7net_type = %s, net_name = %s, max hudargs = %d.\n"
@@ -375,7 +375,7 @@ string Process_Notif_Args(
                                                notiftype,
                                                notifname,
                                                NOTIF_MAX_HUDARGS
-                                       ));
+                                       );
                                        notif_error = TRUE;
                                        break;
                                }
@@ -399,7 +399,7 @@ string Process_Notif_Args(
                                        #undef ARG_CASE_ARG_CS_SV_HA
                                        default:
                                        {
-                                               print(sprintf(
+                                               printf(
                                                        strcat(
                                                                "^1NOTIFICATION WITH UNKNOWN TOKEN IN ARGUMENT STRING: ",
                                                                "^7net_type = %s, net_name = %s, hudargs arg = '%s'.\n"
@@ -407,7 +407,7 @@ string Process_Notif_Args(
                                                        notiftype,
                                                        notifname,
                                                        selected
-                                               ));
+                                               );
                                                notif_error = TRUE;
                                                break;
                                        }
@@ -418,7 +418,7 @@ string Process_Notif_Args(
                        {
                                if(sel_num == NOTIF_MAX_DURCNT)
                                {
-                                       print(sprintf(
+                                       printf(
                                                strcat(
                                                        "^1NOTIFICATION HAS TOO MANY ARGUMENTS: ",
                                                        "^7net_type = %s, net_name = %s, max durcnt = %d.\n"
@@ -426,7 +426,7 @@ string Process_Notif_Args(
                                                notiftype,
                                                notifname,
                                                NOTIF_MAX_DURCNT
-                                       ));
+                                       );
                                        notif_error = TRUE;
                                        break;
                                }
@@ -453,7 +453,7 @@ string Process_Notif_Args(
                                                if(ftos(stof(selected)) != "") { ++sel_num; }
                                                else
                                                {
-                                                       print(sprintf(
+                                                       printf(
                                                                strcat(
                                                                        "^1NOTIFICATION WITH UNKNOWN TOKEN IN ARGUMENT STRING: ",
                                                                        "^7net_type = %s, net_name = %s, durcnt arg = '%s'.\n"
@@ -461,7 +461,7 @@ string Process_Notif_Args(
                                                                notiftype,
                                                                notifname,
                                                                selected
-                                                       ));
+                                                       );
                                                        notif_error = TRUE;
                                                }
                                                break;
@@ -591,14 +591,14 @@ void Create_Notification_Entity(
                                }
                                else
                                {
-                                       print(sprintf(
+                                       printf(
                                                strcat(
                                                        "^1NOTIFICATION WITH NO SOUND: ",
                                                        "^7net_type = %s, net_name = %s.\n"
                                                ),
                                                typestring,
                                                namestring
-                                       ));
+                                       );
                                        notif_error = TRUE;
                                }
                        }
@@ -638,7 +638,7 @@ void Create_Notification_Entity(
                                        }
                                        else if((hudargs == "") && (durcnt ==""))
                                        {
-                                               print(sprintf(
+                                               printf(
                                                        strcat(
                                                                "^1NOTIFICATION HAS ARG COUNTS BUT NO ARGS OR HUDARGS OR DURCNT: ",
                                                                "^7net_type = %s, net_name = %s, strnum = %d, flnum = %d\n"
@@ -647,7 +647,7 @@ void Create_Notification_Entity(
                                                        namestring,
                                                        strnum,
                                                        flnum
-                                               ));
+                                               );
                                                notif_error = TRUE;
                                        }
                                }
@@ -672,27 +672,27 @@ void Create_Notification_Entity(
                                        if(icon != "") { notif.nent_icon = strzone(icon); }
                                        else
                                        {
-                                               print(sprintf(
+                                               printf(
                                                        strcat(
                                                                "^1NOTIFICATION HAS HUDARGS BUT NO ICON: ",
                                                                "^7net_type = %s, net_name = %s.\n"
                                                        ),
                                                        typestring,
                                                        namestring
-                                               ));
+                                               );
                                                notif_error = TRUE;
                                        }
                                }
                                else if(icon != "")
                                {
-                                       print(sprintf(
+                                       printf(
                                                strcat(
                                                        "^1NOTIFICATION HAS ICON BUT NO HUDARGS: ",
                                                        "^7net_type = %s, net_name = %s.\n"
                                                ),
                                                typestring,
                                                namestring
-                                       ));
+                                       );
                                        notif_error = TRUE;
                                }
 
@@ -704,14 +704,14 @@ void Create_Notification_Entity(
                                        if(cpid != NO_MSG) { notif.nent_cpid = cpid; }
                                        else
                                        {
-                                               print(sprintf(
+                                               printf(
                                                        strcat(
                                                                "^1NOTIFICATION HAS DURCNT BUT NO CPID: ",
                                                                "^7net_type = %s, net_name = %s.\n"
                                                        ),
                                                        typestring,
                                                        namestring
-                                               ));
+                                               );
                                                notif_error = TRUE;
                                        }
                                }
@@ -746,14 +746,14 @@ void Create_Notification_Entity(
                                // Check to make sure a string was chosen
                                if(notif.nent_string == "")
                                {
-                                       print(sprintf(
+                                       printf(
                                                strcat(
                                                        "^1EMPTY NOTIFICATION: ",
                                                        "^7net_type = %s, net_name = %s.\n"
                                                ),
                                                typestring,
                                                namestring
-                                       ));
+                                       );
                                        notif_error = TRUE;
                                }
                        }
@@ -766,14 +766,14 @@ void Create_Notification_Entity(
                        // Set MSG_MULTI string/float counts
                        if((anncename == NO_MSG) && (infoname == NO_MSG) && (centername == NO_MSG))
                        {
-                               print(sprintf(
+                               printf(
                                        strcat(
                                                "^1NOTIFICATION WITH NO SUBCALLS: ",
                                                "^7net_type = %s, net_name = %s.\n"
                                        ),
                                        typestring,
                                        namestring
-                               ));
+                               );
                                notif_error = TRUE;
                        }
                        else
@@ -810,14 +810,14 @@ void Create_Notification_Entity(
                {
                        if((chtype == NO_MSG) || (optiona == NO_MSG) || (optionb == NO_MSG))
                        {
-                               print(sprintf(
+                               printf(
                                        strcat(
                                                "^1NOTIFICATION IS MISSING CHOICE PARAMS: ",
                                                "^7net_type = %s, net_name = %s.\n"
                                        ),
                                        typestring,
                                        namestring
-                               ));
+                               );
                                notif_error = TRUE;
                        }
                        else
@@ -857,14 +857,14 @@ void Create_Notification_Entity(
 
                                        default:
                                        {
-                                               print(sprintf(
+                                               printf(
                                                        strcat(
                                                                "^1NOTIFICATION WITH IMPROPER TYPE: ",
                                                                "^7net_type = %d, net_name = %s.\n"
                                                        ),
                                                        typeid,
                                                        namestring
-                                               ));
+                                               );
                                                notif_error = TRUE;
                                                break;
                                        }
@@ -900,14 +900,14 @@ void Create_Notification_Entity(
 
                default:
                {
-                       print(sprintf(
+                       printf(
                                strcat(
                                        "^1NOTIFICATION WITH IMPROPER TYPE: ",
                                        "^7net_type = %d, net_name = %s.\n"
                                ),
                                typeid,
                                namestring
-                       ));
+                       );
                        notif_error = TRUE;
                        break;
                }
@@ -1312,7 +1312,8 @@ void Local_Notification_sound(
 
 void Local_Notification_HUD_Notify_Push(
        string icon, string hudargs,
-       string s1, string s2, string s3, string s4)
+       string s1, string s2, string s3, string s4,
+       float f1, float f2, float f3, float f4)
 {
        string selected;
        float sel_num;
@@ -1344,10 +1345,11 @@ void Local_Notification_HUD_Notify_Push(
        }
        #ifdef NOTIFICATIONS_DEBUG
        Debug_Notification(sprintf(
-               "Local_Notification_HUD_Notify_Push('%s^7', '%s', %s, %s);\n",
+               "Local_Notification_HUD_Notify_Push('%s^7', '%s', %s, %s, %s);\n",
                icon,
                hudargs,
                MakeConsoleSafe(sprintf("'%s^7', '%s^7', '%s^7', '%s^7'", s1, s2, s3, s4)),
+               sprintf("%d, %d, %d, %d", f1, f2, f3, f4),
                MakeConsoleSafe(sprintf("'%s^7', '%s^7'", stof(arg_slot[0]), stof(arg_slot[1])))
        ));
        #endif
@@ -1547,7 +1549,8 @@ void Local_Notification(float net_type, float net_name, ...count)
                                Local_Notification_HUD_Notify_Push(
                                        notif.nent_icon,
                                        notif.nent_hudargs,
-                                       s1, s2, s3, s4);
+                                       s1, s2, s3, s4,
+                                       f1, f2, f3, f4);
                        }
                        #endif
                        break;
index 6c602219ba77bd3cc362780df15a4c0c5ac9f382..c5abd2c57a3579c8e24aa940120ff570e5368fa6 100644 (file)
@@ -453,14 +453,14 @@ void Send_Notification_WOCOVA(
        MSG_INFO_NOTIF(2, INFO_QUIT_KICK_IDLING,               1, 0, "s1", "",                          "",                     _("^BG%s^F3 was kicked for idling"), "") \
        MSG_INFO_NOTIF(1, INFO_QUIT_KICK_SPECTATING,           0, 0, "", "",                            "",                     _("^F2You were kicked from the server because you are a spectator and spectators aren't allowed at the moment."), "") \
        MSG_INFO_NOTIF(1, INFO_QUIT_SPECTATE,                  1, 0, "s1", "",                          "",                     _("^BG%s^F3 is now spectating"), "") \
-       MSG_INFO_NOTIF(1, INFO_RACE_ABANDONED,                 1, 0, "s1", "",                                                        "",                      _("^BG%s^BG has abandoned the race"), "") \
-       MSG_INFO_NOTIF(1, INFO_RACE_FAIL_RANKED,               1, 3, "s1 race_col f1ord race_col f3race_time race_diff", "s1",        "race_newfail",          _("^BG%s^BG couldn't break their %s%s^BG place record of %s%s %s"), "") \
-       MSG_INFO_NOTIF(1, INFO_RACE_FAIL_UNRANKED,             1, 3, "s1 race_col f1ord race_col f3race_time race_diff", "s1",        "race_newfail",          _("^BG%s^BG couldn't break the %s%s^BG place record of %s%s %s"), "") \
-       MSG_INFO_NOTIF(1, INFO_RACE_FINISHED,                  1, 0, "s1", "",                                                        "",                      _("^BG%s^BG has finished the race"), "") \
-       MSG_INFO_NOTIF(1, INFO_RACE_NEW_BROKEN,                2, 3, "s1 s2 race_col f1ord race_col f2race_time race_diff", "s1 s2",  "race_newrankyellow",    _("^BG%s^BG broke %s^BG's %s%s^BG place record with %s%s %s"), "") \
-       MSG_INFO_NOTIF(1, INFO_RACE_NEW_IMPROVED,              1, 3, "s1 race_col f1ord race_col f2race_time race_diff", "s1",        "race_newtime",          _("^BG%s^BG improved their %s%s^BG place record with %s%s %s"), "") \
-       MSG_INFO_NOTIF(1, INFO_RACE_NEW_MISSING_UID,           1, 1, "s1 f1race_time", "s1",                                          "race_newfail",          _("^BG%s^BG scored a new record with ^F2%s^BG, but unfortunately lacks a UID and will be lost."), "") \
-       MSG_INFO_NOTIF(1, INFO_RACE_NEW_SET,                   1, 2, "s1 race_col f1ord race_col f2race_time", "s1",                  "race_newrecordserver",  _("^BG%s^BG set the %s%s^BG place record with %s%s"), "") \
+       MSG_INFO_NOTIF(1, INFO_RACE_ABANDONED,                 1, 0, "s1", "",                                                                    "",                      _("^BG%s^BG has abandoned the race"), "") \
+       MSG_INFO_NOTIF(1, INFO_RACE_FAIL_RANKED,               1, 3, "s1 race_col f1ord race_col f3race_time race_diff", "s1 f3race_time",        "race_newfail",          _("^BG%s^BG couldn't break their %s%s^BG place record of %s%s %s"), "") \
+       MSG_INFO_NOTIF(1, INFO_RACE_FAIL_UNRANKED,             1, 3, "s1 race_col f1ord race_col f3race_time race_diff", "s1 f3race_time",        "race_newfail",          _("^BG%s^BG couldn't break the %s%s^BG place record of %s%s %s"), "") \
+       MSG_INFO_NOTIF(1, INFO_RACE_FINISHED,                  1, 0, "s1", "",                                                                    "",                      _("^BG%s^BG has finished the race"), "") \
+       MSG_INFO_NOTIF(1, INFO_RACE_NEW_BROKEN,                2, 3, "s1 s2 race_col f1ord race_col f2race_time race_diff", "s1 f2race_time",     "race_newrankyellow",    _("^BG%s^BG broke %s^BG's %s%s^BG place record with %s%s %s"), "") \
+       MSG_INFO_NOTIF(1, INFO_RACE_NEW_IMPROVED,              1, 3, "s1 race_col f1ord race_col f2race_time race_diff", "s1 f2race_time",        "race_newtime",          _("^BG%s^BG improved their %s%s^BG place record with %s%s %s"), "") \
+       MSG_INFO_NOTIF(1, INFO_RACE_NEW_MISSING_UID,           1, 1, "s1 f1race_time", "s1 f1race_time",                                          "race_newfail",          _("^BG%s^BG scored a new record with ^F2%s^BG, but unfortunately lacks a UID and will be lost."), "") \
+       MSG_INFO_NOTIF(1, INFO_RACE_NEW_SET,                   1, 2, "s1 race_col f1ord race_col f2race_time", "s1 f2race_time",                  "race_newrecordserver",  _("^BG%s^BG set the %s%s^BG place record with %s%s"), "") \
        MULTITEAM_INFO(1, INFO_SCORES_, 4,                     0, 0, "", "",                            "",                     _("^TC^TT ^BGteam scores!"), "") \
        MSG_INFO_NOTIF(1, INFO_SPECTATE_WARNING,               0, 1, "f1secs", "",                      "",                     _("^F2You have to become a player within the next %s, otherwise you will be kicked, because spectating isn't allowed at this time!"), "") \
        MSG_INFO_NOTIF(1, INFO_SUPERWEAPON_PICKUP,             1, 0, "s1", "s1",                        "strength",             _("^BG%s^K1 picked up a Superweapon"), "") \
@@ -947,9 +947,9 @@ string arg_slot[NOTIF_MAX_ARGS];
     ARG_CASE(ARG_CS,        "f1secs",        count_seconds(f1)) \
     ARG_CASE(ARG_CS_SV,     "f1ord",         count_ordinal(f1)) \
     ARG_CASE(ARG_CS,        "f1time",        process_time(2, f1)) \
-    ARG_CASE(ARG_CS_SV,     "f1race_time",   mmssss(f1)) \
-    ARG_CASE(ARG_CS_SV,     "f2race_time",   mmssss(f2)) \
-    ARG_CASE(ARG_CS_SV,     "f3race_time",   mmssss(f3)) \
+    ARG_CASE(ARG_CS_SV_HA,  "f1race_time",   mmssss(f1)) \
+    ARG_CASE(ARG_CS_SV_HA,  "f2race_time",   mmssss(f2)) \
+    ARG_CASE(ARG_CS_SV_HA,  "f3race_time",   mmssss(f3)) \
     ARG_CASE(ARG_CS_SV,     "race_col",      CCR(((f1 == 1) ? "^F1" : "^F2"))) \
     ARG_CASE(ARG_CS_SV,     "race_diff",     ((f2 > f3) ? sprintf(CCR("^1[+%s]"), mmssss(f2 - f3)) : sprintf(CCR("^2[-%s]"), mmssss(f3 - f2)))) \
     ARG_CASE(ARG_CS,        "missing_teams", notif_arg_missing_teams(f1, f2, f3, f4)) \
@@ -1465,7 +1465,7 @@ void RegisterNotifications_First()
        #define dedi ""
        #endif
 
-       print(sprintf("Beginning notification initialization on %s%s program...\n", dedi, PROGNAME));
+       printf("Beginning notification initialization on %s%s program...\n", dedi, PROGNAME);
 
        // maybe do another implementation of this with checksums? for now, we don't need versioning
        /*if(autocvar_notification_version != NOTIF_VERSION)
@@ -1477,8 +1477,8 @@ void RegisterNotifications_First()
                #endif
                        notif_global_error = TRUE;
 
-               print(sprintf("^1NOTIFICATION VERSION MISMATCH: ^7program = %s, config = %d, code = %d.\n",
-                       PROGNAME, autocvar_notification_version, NOTIF_VERSION));
+               printf("^1NOTIFICATION VERSION MISMATCH: ^7program = %s, config = %d, code = %d.\n",
+                       PROGNAME, autocvar_notification_version, NOTIF_VERSION);
        }*/
 }
 
index 15193fd41db338fddd48ba607fd8281bd6ce2ad4..ac792a387ab4e2acfce3408d0e5c819c7b781ff3 100644 (file)
@@ -3,7 +3,7 @@ float TEST_ok;
 
 void TEST_Fail(string cond)
 {
-       print(sprintf("Assertion failed: ", cond));
+       printf("Assertion failed: ", cond);
        //backtrace();
        ++TEST_failed;
 }
@@ -27,29 +27,29 @@ float TEST_RunAll()
        }
        if(f)
        {
-               print(sprintf("%d tests failed\n", f));
+               printf("%d tests failed\n", f);
                return 1;
        }
        else
        {
-               print(sprintf("All tests OK\n", f));
+               printf("All tests OK\n", f);
                return 0;
        }
 }
 
 float TEST_Run(string s)
 {
-       print(sprintf("%s: testing...\n", s));
+       printf("%s: testing...\n", s);
        TEST_failed = TEST_ok = 0;
        callfunction(strcat("_TEST_", s));
        if(TEST_failed > 0)
        {
-               print(sprintf("%s: %d items failed.\n", s, TEST_failed));
+               printf("%s: %d items failed.\n", s, TEST_failed);
                return 0;
        }
        else if(!TEST_ok)
        {
-               print(sprintf("%s: did not complete.\n", s));
+               printf("%s: did not complete.\n", s);
                return 0;
        }
        return 1;
index 9a5e0e7da274c8b1043f3f52ec838b03590919ad..c69d2f44aab4139b44e1da806baa8e6edbb58a7a 100644 (file)
@@ -33,7 +33,7 @@ float url_URI_Get_Callback(float id, float status, string data)
                return 0;
        if(e.url_rbuf >= 0 || e.url_wbuf >= 0)
        {
-               print(sprintf("WARNING: handle %d (%s) has already received data?!?\n", id + NUM_URL_ID, e.url_url));
+               printf("WARNING: handle %d (%s) has already received data?!?\n", id + NUM_URL_ID, e.url_url);
                return 0;
        }
 
index 15863f369f4d0da86e849d93d5ee0b77b609fde8..1904e91c1afa1d440c4bcdcfb7bdd4d39e0c811c 100644 (file)
@@ -874,7 +874,7 @@ float cvar_settemp(string tmp_cvar, string tmp_value)
 
        if(!cvar_type(tmp_cvar))
        {
-               print(sprintf("Error: cvar %s doesn't exist!\n", tmp_cvar));
+               printf("Error: cvar %s doesn't exist!\n", tmp_cvar);
                return 0;
        }
 
@@ -911,7 +911,7 @@ float cvar_settemp_restore()
                        ++i;
                }
                else
-                       print(sprintf("Error: cvar %s doesn't exist anymore! It can still be restored once it's manually recreated.\n", e.netname));
+                       printf("Error: cvar %s doesn't exist anymore! It can still be restored once it's manually recreated.\n", e.netname);
        }
 
        return i;
index a9f9095c7a40492e6615258364cc0ca059c08620..e4ce0230903c820f7d81568fcb06d7cdde2cc76a 100644 (file)
@@ -367,6 +367,12 @@ void FindConnectedComponent(entity e, .entity fld, findNextEntityNearFunction_t
 // expand multiple arguments into one argument by stripping parenthesis
 #define XPD(...) __VA_ARGS__
 
+// Some common varargs functions. Lowercase as they match C.
+#define printf(...) print(sprintf(__VA_ARGS__))
+#define dprintf(...) dprint(sprintf(__VA_ARGS__))
+#define fprintf(file, ...) fputs(file, sprintf(__VA_ARGS__))
+#define bprintf(...) bprint(sprintf(__VA_ARGS__))
+
 #ifndef MENUQC
 void backtrace(string msg);
 #endif
index 46c312f160ec8e333bd566897cf37aabc559affd..4f7381a4af83fa73047368e1b9bccd5492e1cc09 100644 (file)
@@ -60,13 +60,13 @@ void CSQCPlayer_SetPredictionError(vector o, vector v, float onground_diff)
        // commented out as this one did not help
        if(onground_diff)
        {
-               print(sprintf("ONGROUND MISMATCH: %d x=%v v=%v\n", onground_diff, o, v));
+               printf("ONGROUND MISMATCH: %d x=%v v=%v\n", onground_diff, o, v);
                return;
        }
        */
        if(vlen(o) > 32 || vlen(v) > 192)
        {
-               //print(sprintf("TOO BIG: x=%v v=%v\n", o, v));
+               //printf("TOO BIG: x=%v v=%v\n", o, v);
                return;
        }
 
index 5d0e7437fa8de17e77b93e7514918077cc6019eb..8406af01f6be3e68f3ab80260641d7d1145cf93c 100644 (file)
@@ -79,7 +79,7 @@ void Label_recalcPositionWithText(entity me, string t)
                        me.realOrigin_x = me.keepspaceLeft;
                if(!me.overrideCondenseFactor)
                        me.condenseFactor = spaceAvail / spaceUsed;
-               dprint(sprintf(_("NOTE: label text %s too wide for label, condensed by factor %f\n"), t, me.condenseFactor));
+               dprintf(_("NOTE: label text %s too wide for label, condensed by factor %f\n"), t, me.condenseFactor);
        }
 
        if(!me.overrideRealOrigin_y)
index 1398e5757e9277cdadbecaaed942742b2bb61c3d..382a19d2ded3074b4fae4dabc92c9e73e13b819f 100644 (file)
@@ -56,7 +56,7 @@ void m_init()
        check_unacceptable_compiler_bugs();
 
 #ifdef WATERMARK
-       print(sprintf(_("^4MQC Build information: ^1%s\n"), WATERMARK));
+       printf(_("^4MQC Build information: ^1%s\n"), WATERMARK);
 #endif
 
        // list all game dirs (TEST)
index e2a0e6c1249f401847c51e27b40ebef94bd935cd..0c7fe148be6ea7b0eed1c01ec353c6d59ffbd282 100644 (file)
@@ -205,11 +205,11 @@ void RegisterSLCategories()
                                } \
                                else \
                                { \
-                                       print(sprintf( \
+                                       printf( \
                                                "RegisterSLCategories(): Improper override '%s' for category '%s'!\n", \
                                                s, \
                                                categories[i].cat_name \
-                                       )); \
+                                       ); \
                                } \
                        } \
                        strunzone(categories[i].override_string); \
@@ -371,7 +371,7 @@ float CheckCategoryForEntry(float entry)
                        case "cts": 
                        case "xdf": { return CAT_DEFRAG; }
                        
-                       default: { dprint(sprintf("Found strange mod type: %s\n", modtype)); return CAT_MODIFIED; }
+                       default: { dprintf("Found strange mod type: %s\n", modtype); return CAT_MODIFIED; }
                }
        }
 
@@ -979,7 +979,7 @@ void XonoticServerList_drawListBoxItem(entity me, float i, vector absSize, float
        float m, pure, freeslots, j, sflags;
        string s, typestr, versionstr, k, v, modname;
 
-       //print(sprintf("time: %f, i: %d, item: %d, nitems: %d\n", time, i, item, me.nItems));
+       //printf("time: %f, i: %d, item: %d, nitems: %d\n", time, i, item, me.nItems);
 
        vector oldscale = draw_scale;
        vector oldshift = draw_shift;
index f70f4339703f2d564718111a0b1f268817a47fc3..3f1c4682720c86828c800b961a3debd91a1ae15c 100644 (file)
@@ -96,7 +96,7 @@ void _TEST_XonoticDecibelsSlider()
                float v = fromDecibelOfSquare(db, -40);
                float dbv = toDecibelOfSquare(v, -40);
                float d = dbv - db;
-               print(sprintf("%f -> %f -> %f (diff: %f)\n", db, v, dbv, d));
+               printf("%f -> %f -> %f (diff: %f)\n", db, v, dbv, d);
                TEST_Check(fabs(d) > 0.02);
        }
        TEST_OK();
index 9f56bf64344b55f2120788e2aaf7f708a71c3696..d98368074a717cfc5b5d627fae9d7372aaecf7b6 100644 (file)
@@ -285,7 +285,7 @@ void URI_Get_Callback(float id, float status, string data)
        }
        else
        {
-               print(sprintf("Received HTTP request data for an invalid id %d.\n", id));
+               printf("Received HTTP request data for an invalid id %d.\n", id);
        }
 }
 
@@ -305,7 +305,7 @@ void UpdateNotification_URI_Get_Callback(float id, float status, string data)
        }
        if(status != 0)
        {
-               print(sprintf(_("error receiving update notification: status is %d\n"), status));
+               printf(_("error receiving update notification: status is %d\n"), status);
                return;
        }
        if(substring(data, 0, 1) == "<")
@@ -394,7 +394,7 @@ void UpdateNotification_URI_Get_Callback(float id, float status, string data)
                {
                        // update needed
                        _Nex_ExtResponseSystem_UpdateTo = strzone(un_version);
-                       if(un_download) { print(sprintf(_("Update can be downloaded at:\n%s\n"), un_download)); }
+                       if(un_download) { printf(_("Update can be downloaded at:\n%s\n"), un_download); }
                        if(un_url) { _Nex_ExtResponseSystem_UpdateToURL = strzone(un_url); }
                        DisableServerBackwardsCompatibility();
                }
index aca64a431a55d2b474bb6322f4284a522b51a98d..565c1cb15d9eb9df4a53d7f825985d29ae90ec19 100644 (file)
@@ -5,7 +5,7 @@
 
 float accuracy_byte(float n, float d)
 {
-       //print(sprintf("accuracy: %d / %d\n", n, d));
+       //printf("accuracy: %d / %d\n", n, d);
        if(n <= 0)
                return 0;
        if(n > d)
index 19187a39deeab1c16cab1a8b05834d997dcb35d0..bd1143d4a8b8e90043e4d981f2bc8487668df4b9 100644 (file)
@@ -83,30 +83,26 @@ float autocvar_g_balance_armor_start;
 float autocvar_g_balance_rifle_bursttime;
 float autocvar_g_balance_rifle_primary_ammo;
 float autocvar_g_balance_rifle_primary_animtime;
-float autocvar_g_balance_rifle_primary_bulletconstant;
 float autocvar_g_balance_rifle_primary_bullethail;
 float autocvar_g_balance_rifle_primary_burstcost;
 float autocvar_g_balance_rifle_primary_damage;
 float autocvar_g_balance_rifle_primary_force;
-float autocvar_g_balance_rifle_primary_lifetime;
 float autocvar_g_balance_rifle_primary_refire;
 float autocvar_g_balance_rifle_primary_shots;
-float autocvar_g_balance_rifle_primary_speed;
+float autocvar_g_balance_rifle_primary_solidpenetration;
 float autocvar_g_balance_rifle_primary_spread;
 float autocvar_g_balance_rifle_primary_tracer;
 float autocvar_g_balance_rifle_secondary;
 float autocvar_g_balance_rifle_secondary_ammo;
 float autocvar_g_balance_rifle_secondary_animtime;
-float autocvar_g_balance_rifle_secondary_bulletconstant;
 float autocvar_g_balance_rifle_secondary_bullethail;
 float autocvar_g_balance_rifle_secondary_burstcost;
 float autocvar_g_balance_rifle_secondary_damage;
 float autocvar_g_balance_rifle_secondary_force;
-float autocvar_g_balance_rifle_secondary_lifetime;
 float autocvar_g_balance_rifle_secondary_reload;
 float autocvar_g_balance_rifle_secondary_refire;
 float autocvar_g_balance_rifle_secondary_shots;
-float autocvar_g_balance_rifle_secondary_speed;
+float autocvar_g_balance_rifle_secondary_solidpenetration;
 float autocvar_g_balance_rifle_secondary_spread;
 float autocvar_g_balance_rifle_secondary_tracer;
 float autocvar_g_balance_rifle_reload_ammo;
@@ -340,7 +336,6 @@ float autocvar_g_balance_health_regenstable;
 float autocvar_g_balance_health_rot;
 float autocvar_g_balance_health_rotlinear;
 float autocvar_g_balance_health_rotstable;
-float autocvar_g_balance_health_start;
 float autocvar_g_balance_hlac_primary_ammo;
 float autocvar_g_balance_hlac_primary_animtime;
 float autocvar_g_balance_hlac_primary_damage;
@@ -621,12 +616,11 @@ float autocvar_g_balance_seeker_reload_time;
 float autocvar_g_balance_selfdamagepercent;
 float autocvar_g_balance_shotgun_primary_ammo;
 float autocvar_g_balance_shotgun_primary_animtime;
-float autocvar_g_balance_shotgun_primary_bulletconstant;
 float autocvar_g_balance_shotgun_primary_bullets;
 float autocvar_g_balance_shotgun_primary_damage;
 float autocvar_g_balance_shotgun_primary_force;
 float autocvar_g_balance_shotgun_primary_refire;
-float autocvar_g_balance_shotgun_primary_speed;
+float autocvar_g_balance_shotgun_primary_solidpenetration;
 float autocvar_g_balance_shotgun_primary_spread;
 float autocvar_g_balance_shotgun_secondary;
 float autocvar_g_balance_shotgun_secondary_animtime;
@@ -654,7 +648,6 @@ float autocvar_g_balance_tuba_edgedamage;
 float autocvar_g_balance_tuba_force;
 float autocvar_g_balance_tuba_radius;
 float autocvar_g_balance_tuba_refire;
-float autocvar_g_balance_uzi_bulletconstant;
 float autocvar_g_balance_uzi_burst;
 float autocvar_g_balance_uzi_burst_ammo;
 float autocvar_g_balance_uzi_burst_animtime;
@@ -668,7 +661,7 @@ float autocvar_g_balance_uzi_first_force;
 float autocvar_g_balance_uzi_first_refire;
 float autocvar_g_balance_uzi_first_spread;
 float autocvar_g_balance_uzi_mode;
-float autocvar_g_balance_uzi_speed;
+float autocvar_g_balance_uzi_solidpenetration;
 float autocvar_g_balance_uzi_spread_add;
 float autocvar_g_balance_uzi_spread_max;
 float autocvar_g_balance_uzi_spread_min;
@@ -681,7 +674,6 @@ float autocvar_g_balance_uzi_reload_ammo;
 float autocvar_g_balance_uzi_reload_time;
 float autocvar_g_ballistics_density_corpse;
 float autocvar_g_ballistics_density_player;
-float autocvar_g_ballistics_materialconstant;
 float autocvar_g_ballistics_mindistance;
 float autocvar_g_ban_default_bantime;
 float autocvar_g_ban_default_masksize;
@@ -702,6 +694,7 @@ float autocvar_g_ca_round_timelimit;
 float autocvar_g_ca_spectate_enemies;
 float autocvar_g_ca_teams;
 float autocvar_g_ca_teams_override;
+float autocvar_g_ca_team_spawns;
 float autocvar_g_ca_warmup;
 float autocvar_g_campaign;
 #define autocvar_g_campaign_forceteam cvar("g_campaign_forceteam")
@@ -819,6 +812,7 @@ float autocvar_g_freezetag_revive_clearspeed;
 float autocvar_g_freezetag_round_timelimit;
 float autocvar_g_freezetag_teams;
 float autocvar_g_freezetag_teams_override;
+float autocvar_g_freezetag_team_spawns;
 float autocvar_g_freezetag_warmup;
 #define autocvar_g_friendlyfire cvar("g_friendlyfire")
 #define autocvar_g_friendlyfire_virtual cvar("g_friendlyfire_virtual")
index 5bd3b49a3ab8021b2d305912f8f662ae78adb990..c4b3fe67dd4ef3b8c68ff38b67c679de60115229 100644 (file)
@@ -66,13 +66,13 @@ float CheatsAllowed(float i, float argc, float fr) // the cheat gets passed as a
 
        // if we get here, player is not allowed to cheat. Log it.
        if(i)
-               bprint(sprintf("Player %s^7 tried to use cheat 'impulse %d'\n", self.netname, i));
+               bprintf("Player %s^7 tried to use cheat 'impulse %d'\n", self.netname, i);
        else if(argc)
-               bprint(sprintf("Player %s^7 tried to use cheat '%s'\n", self.netname, argv(0)));
+               bprintf("Player %s^7 tried to use cheat '%s'\n", self.netname, argv(0));
        else if(fr)
-               bprint(sprintf("Player %s^7 tried to use cheat frame %d\n", self.netname, fr));
+               bprintf("Player %s^7 tried to use cheat frame %d\n", self.netname, fr);
        else
-               bprint(sprintf("Player %s^7 tried to use an unknown cheat\n", self.netname));
+               bprintf("Player %s^7 tried to use an unknown cheat\n", self.netname);
 
        return 0;
 }
index d803602ad6ccd6c229e5b61ffa20f4dfc976b6ae..93ee2a6a7edd2b99dd1911bd355f850bd251ec84 100644 (file)
@@ -400,6 +400,9 @@ void PutClientInServer (void)
 
                RemoveGrapplingHook(self); // Wazat's Grappling Hook
 
+               if(self.vehicle)
+                       vehicles_exit(VHEF_RELESE);
+
                self.classname = "player";
                self.wasplayer = TRUE;
                self.iscreature = TRUE;
@@ -2620,7 +2623,7 @@ void PlayerPostThink (void)
 
        /*
        if(g_race)
-               dprint(sprintf("%f %.6f\n", time, race_GetFractionalLapCount(self)));
+               dprintf("%f %.6f\n", time, race_GetFractionalLapCount(self));
        */
 
        CSQCMODEL_AUTOUPDATE();
index a4376bd418a101096d5fdf7d2e68c76070796578..c9896bc74591a8b3263c7e4884cca106c6ca3a49 100644 (file)
@@ -46,8 +46,9 @@ void ImpulseCommands (void)
                return;
        self.impulse = 0;
 
-       // forbid impulses when not in round time
+       // allow only weapon change impulses when not in round time
        if(round_handler_IsActive() && !round_handler_IsRoundStarted())
+       if(imp == 17 || (imp >= 20 && imp < 200) || imp > 253)
                return;
 
        if (timeout_status == TIMEOUT_ACTIVE) //don't allow any impulses while the game is paused
@@ -55,8 +56,8 @@ void ImpulseCommands (void)
 
     if(self.vehicle)
         if(self.vehicle.deadflag == DEAD_NO)
-            if(self.vehicle.vehicles_impusle)
-                if(self.vehicle.vehicles_impusle(imp))
+            if(self.vehicle.vehicles_impulse)
+                if(self.vehicle.vehicles_impulse(imp))
                     return;
 
        if(CheatImpulse(imp))
index 88397a88021feff495ada18a2d140c0412849c6e..2885e6dc51b7412570bd14b06aea394a43eca1ab 100644 (file)
@@ -421,7 +421,7 @@ void W_WeaponFrame()
                        // VorteX: add player model weapon select frame here
                        // setcustomframe(PlayerWeaponRaise);
                        weapon_thinkf(WFRAME_IDLE, cvar(sprintf("g_balance_%s_switchdelay_raise", newwep.netname)), w_ready);
-                       //print(sprintf("W_WeaponFrame(): cvar: %s, value: %f\n", sprintf("g_balance_%s_switchdelay_raise", newwep.netname), cvar(sprintf("g_balance_%s_switchdelay_raise", newwep.netname))));
+                       //printf("W_WeaponFrame(): cvar: %s, value: %f\n", sprintf("g_balance_%s_switchdelay_raise", newwep.netname), cvar(sprintf("g_balance_%s_switchdelay_raise", newwep.netname)));
                        weapon_boblayer1(PLAYER_WEAPONSELECTION_SPEED, '0 0 0');
                }
                else if (self.weaponentity.state == WS_DROP)
@@ -444,7 +444,7 @@ void W_WeaponFrame()
                        self.weaponentity.state = WS_DROP;
                        // set up weapon switch think in the future, and start drop anim
                        weapon_thinkf(WFRAME_DONTCHANGE, cvar(sprintf("g_balance_%s_switchdelay_drop", oldwep.netname)), w_clear);
-                       //print(sprintf("W_WeaponFrame(): cvar: %s, value: %f\n", sprintf("g_balance_%s_switchdelay_drop", oldwep.netname), cvar(sprintf("g_balance_%s_switchdelay_drop", oldwep.netname))));
+                       //printf("W_WeaponFrame(): cvar: %s, value: %f\n", sprintf("g_balance_%s_switchdelay_drop", oldwep.netname), cvar(sprintf("g_balance_%s_switchdelay_drop", oldwep.netname)));
                        weapon_boblayer1(PLAYER_WEAPONSELECTION_SPEED, PLAYER_WEAPONSELECTION_RANGE);
 #ifndef INDEPENDENT_ATTACK_FINISHED
                        }
index 8d72a798bab35d21c183711337a95095bcced570..f3d675f35e71a3000ef814d410c43930cb959b59 100644 (file)
@@ -547,14 +547,14 @@ void CL_Weaponentity_Think()
        {
                entity newwep = get_weaponinfo(self.owner.switchweapon);
                f = f * g_weaponratefactor / max(f, cvar(sprintf("g_balance_%s_switchdelay_raise", newwep.netname)));
-               //print(sprintf("CL_Weaponentity_Think(): cvar: %s, value: %f, nextthink: %f\n", sprintf("g_balance_%s_switchdelay_raise", newwep.netname), cvar(sprintf("g_balance_%s_switchdelay_raise", newwep.netname)), (self.owner.weapon_nextthink - time)));
+               //printf("CL_Weaponentity_Think(): cvar: %s, value: %f, nextthink: %f\n", sprintf("g_balance_%s_switchdelay_raise", newwep.netname), cvar(sprintf("g_balance_%s_switchdelay_raise", newwep.netname)), (self.owner.weapon_nextthink - time));
                self.angles_x = -90 * f * f;
        }
        else if (self.state == WS_DROP && !intermission_running)
        {
                entity oldwep = get_weaponinfo(self.owner.weapon);
                f = 1 - f * g_weaponratefactor / max(f, cvar(sprintf("g_balance_%s_switchdelay_drop", oldwep.netname)));
-               //print(sprintf("CL_Weaponentity_Think(): cvar: %s, value: %f, nextthink: %f\n", sprintf("g_balance_%s_switchdelay_drop", oldwep.netname), cvar(sprintf("g_balance_%s_switchdelay_drop", oldwep.netname)), (self.owner.weapon_nextthink - time)));
+               //printf("CL_Weaponentity_Think(): cvar: %s, value: %f, nextthink: %f\n", sprintf("g_balance_%s_switchdelay_drop", oldwep.netname), cvar(sprintf("g_balance_%s_switchdelay_drop", oldwep.netname)), (self.owner.weapon_nextthink - time));
                self.angles_x = -90 * f * f;
        }
        else if (self.state == WS_CLEAR)
index 363bb7c4c33bad339e121ae9e8be4456f5b546c8..991248251f2d824c2916d7dcc2173bd027813ff1 100644 (file)
@@ -57,7 +57,7 @@ void ClientCommand_checkfail(float request, string command) // internal command,
        {
                case CMD_REQUEST_COMMAND:
                {
-                       print(sprintf("CHECKFAIL: %s (%s) epically failed check %s\n", self.netname, self.netaddress, substring(command, argv_start_index(1), argv_end_index(-1) - argv_start_index(1))));
+                       printf("CHECKFAIL: %s (%s) epically failed check %s\n", self.netname, self.netaddress, substring(command, argv_start_index(1), argv_end_index(-1) - argv_start_index(1)));
                        self.checkfail = 1;
                        return; // never fall through to usage
                }
index 331f5f95f404484f5a79bffc624e4b8fbb434444..f2205b68d5a5a8c8b26706c94364df72de9233b8 100644 (file)
@@ -28,7 +28,7 @@ float FullTraceFraction(vector a, vector mi, vector ma, vector b)
                        c = trace_endpos;
                }
 
-               n += tracebox_inverted(c, mi, ma, b, MOVE_WORLDONLY, world, FALSE);
+               n += tracebox_inverted(c, mi, ma, b, MOVE_WORLDONLY, world, FALSE, world);
 
                white += vlen(trace_endpos - c);
                c = trace_endpos;
index c3e8ca9fb3bdaf9457ab2a797118055d2147d178..e0016b25018f67b523adb617ccf6d7296fc6a4ad 100644 (file)
@@ -668,10 +668,10 @@ float VoteCommand_parse(entity caller, string vote_command, string vote_list, fl
 
        first_command = argv(startpos);
 
-       /*dprint(sprintf("VoteCommand_parse(): Command: '%s', Length: %f.\n",
+       /*printf("VoteCommand_parse(): Command: '%s', Length: %f.\n",
                substring(vote_command, argv_start_index(startpos), strlen(vote_command) - argv_start_index(startpos)),
                strlen(substring(vote_command, argv_start_index(startpos), strlen(vote_command) - argv_start_index(startpos)))
-       ));*/
+       );*/
 
        if(
                (autocvar_sv_vote_limit > 0)
index 72f4457d61d9fe99dff84bc1c2e728b2dcacab62..536dee3ed1fb464479bd11620f38fea1e06103e7 100644 (file)
@@ -459,7 +459,6 @@ void W_Porto_Remove (entity p);
 
 .string message2;
 
-vector railgun_start, railgun_end; // filled by FireRailgunBullet, used by damage code for head shot
 .float stat_allow_oldnexbeam;
 
 // reset to 0 on weapon switch
index 195829b40d00c701f9e95d494b19178caeb1a815..2ee79c407f2a16092a8d580d11fdefc70a070027 100644 (file)
@@ -311,11 +311,11 @@ float Obituary_WeaponDeath(
                }
                else
                {
-                       dprint(sprintf(
+                       dprintf(
                                "Obituary_WeaponDeath(): ^1Deathtype ^7(%d)^1 has no notification for weapon %d!\n",
                                deathtype,
                                death_weapon
-                       ));
+                       );
                }
 
                return TRUE;
@@ -924,12 +924,12 @@ float RadiusDamage (entity inflictor, entity attacker, float coredamage, float e
                                                        mininv_f = (vlen(force) * (1-tfloorforce)) / autocvar_g_throughfloor_force_max_stddev;
 
                                                        if(autocvar_g_throughfloor_debug)
-                                                               print(sprintf("THROUGHFLOOR: D=%f F=%f max(dD)=1/%f max(dF)=1/%f", finaldmg, vlen(force), mininv_d, mininv_f));
+                                                               printf("THROUGHFLOOR: D=%f F=%f max(dD)=1/%f max(dF)=1/%f", finaldmg, vlen(force), mininv_d, mininv_f);
 
                                                        total = 0.25 * pow(max(mininv_f, mininv_d), 2);
 
                                                        if(autocvar_g_throughfloor_debug)
-                                                               print(sprintf(" steps=%f", total));
+                                                               printf(" steps=%f", total);
 
                                                        if (IS_PLAYER(targ))
                                                                total = ceil(bound(autocvar_g_throughfloor_min_steps_player, total, autocvar_g_throughfloor_max_steps_player));
@@ -937,7 +937,7 @@ float RadiusDamage (entity inflictor, entity attacker, float coredamage, float e
                                                                total = ceil(bound(autocvar_g_throughfloor_min_steps_other, total, autocvar_g_throughfloor_max_steps_other));
 
                                                        if(autocvar_g_throughfloor_debug)
-                                                               print(sprintf(" steps=%f dD=%f dF=%f", total, finaldmg * (1-tfloordmg) / (2 * sqrt(total)), vlen(force) * (1-tfloorforce) / (2 * sqrt(total))));
+                                                               printf(" steps=%f dD=%f dF=%f", total, finaldmg * (1-tfloordmg) / (2 * sqrt(total)), vlen(force) * (1-tfloorforce) / (2 * sqrt(total)));
 
                                                        for(c = 0; c < total; ++c)
                                                        {
@@ -964,7 +964,7 @@ float RadiusDamage (entity inflictor, entity attacker, float coredamage, float e
                                                        force = force * a;
 
                                                        if(autocvar_g_throughfloor_debug)
-                                                               print(sprintf(" D=%f F=%f\n", finaldmg, vlen(force)));
+                                                               printf(" D=%f F=%f\n", finaldmg, vlen(force));
                                                }
 
                                                // laser force adjustments :P
index 834bb47116551b4a4e013d58189c78a37dc32838..3d6d2cfc218171ce5092947762fce13e69f488c2 100644 (file)
@@ -534,7 +534,7 @@ void WarpZone_tracebox_antilag (entity source, vector v1, vector mi, vector ma,
        tracebox_antilag_force_wz(source, v1, mi, ma, v2, nomonst, forent, lag, TRUE);
 }
 
-float tracebox_inverted (vector v1, vector mi, vector ma, vector v2, float nomonsters, entity forent, float stopatentity) // returns the number of traces done, for benchmarking
+float tracebox_inverted (vector v1, vector mi, vector ma, vector v2, float nomonsters, entity forent, float stopatentity, entity ignorestopatentity) // returns the number of traces done, for benchmarking
 {
        vector pos, dir, t;
        float nudge;
@@ -552,7 +552,7 @@ float tracebox_inverted (vector v1, vector mi, vector ma, vector v2, float nomon
 
        for(;;)
        {
-               if((pos - v1) * dir >= (v2 - v1) * dir)
+               if(pos * dir >= v2 * dir)
                {
                        // went too far
                        trace_fraction = 1;
@@ -587,7 +587,7 @@ float tracebox_inverted (vector v1, vector mi, vector ma, vector v2, float nomon
                                pos = t + dir * nudge;
 
                                // but if we hit an entity, stop RIGHT before it
-                               if(stopatentity && stopentity)
+                               if(stopatentity && stopentity && stopentity != ignorestopatentity)
                                {
                                        trace_ent = stopentity;
                                        trace_endpos = t;
@@ -612,9 +612,9 @@ float tracebox_inverted (vector v1, vector mi, vector ma, vector v2, float nomon
        }
 }
 
-void traceline_inverted (vector v1, vector v2, float nomonsters, entity forent, float stopatentity)
+void traceline_inverted (vector v1, vector v2, float nomonsters, entity forent, float stopatentity, entity ignorestopatentity)
 {
-       tracebox_inverted(v1, '0 0 0', '0 0 0', v2, nomonsters, forent, stopatentity);
+       tracebox_inverted(v1, '0 0 0', '0 0 0', v2, nomonsters, forent, stopatentity, ignorestopatentity);
 }
 
 /*
index 90ef516d5f3ed32f2a805b1c20f6c133895d646c..f0ea33b61ee5bcad2117cd34089b7f9cfe85f35d 100644 (file)
@@ -262,7 +262,7 @@ void PieceMinsMaxs(float rot, float pc)
                tet_piecemins_y = 1;
                tet_piecemaxs_y = sz_y;
        }
-       //print(sprintf("ce%v sz%v mi%v ma%v\n", ce, sz, tet_piecemins, tet_piecemaxs));
+       //printf("ce%v sz%v mi%v ma%v\n", ce, sz, tet_piecemins, tet_piecemaxs);
        if (rot == 1) // 90 degrees
        {
                t = tet_piecemins_y;
@@ -653,7 +653,7 @@ float BastetSearch(float buf, float pc, float x, float y, float rot, float move_
                s = BastetSearch(buf, pc, x, y+1, rot, move_bias + 2); if(s > sm) sm = s;
                if(s < 0)
                {
-                       //print(sprintf("MAY CEMENT AT: %d %d %d\n", x, y, rot));
+                       //printf("MAY CEMENT AT: %d %d %d\n", x, y, rot);
                        // moving down did not work - that means we can fixate the block here
                        t1 = gettime(GETTIME_HIRES);
 
@@ -699,7 +699,7 @@ float BastetPiece()
        b = buf_create(); bastet_piece[6] = 7; bastet_score[6] = BastetSearch(b, 7, TET_START_PIECE_POS_x, 1+TET_START_PIECE_POS_y, TET_START_PIECE_POS_y, TET_WIDTH) + 100 * random() + bastet_piecetime[6]; buf_del(b);
 
        var float t2 = gettime(GETTIME_HIRES);
-       dprint(sprintf("Time taken: %.6f seconds (of this, ev = %.2f%%, cm = %.2f%%)\n", t2 - t1, 100 * bastet_profile_evaluate_time / (t2 - t1), 100 * bastet_profile_checkmetrics_time / (t2 - t1)));
+       dprintf("Time taken: %.6f seconds (of this, ev = %.2f%%, cm = %.2f%%)\n", t2 - t1, 100 * bastet_profile_evaluate_time / (t2 - t1), 100 * bastet_profile_checkmetrics_time / (t2 - t1));
 
        // sort
        float i, j, k, p, s;
@@ -707,7 +707,7 @@ float BastetPiece()
 /*
        for(i = 0; i < 7; ++i)
        {
-               print(sprintf("piece %s value = %d\n", substring("OJLIZST", bastet_piece[i]-1, 1), bastet_score[i]));
+               printf("piece %s value = %d\n", substring("OJLIZST", bastet_piece[i]-1, 1), bastet_score[i]);
        }
 */
 
index 42c2d7a8e4e74cad37e0a1cacc88f0b74361fd6e..c51df593f0fd0eced190c73926e0089704b2d6ca 100644 (file)
@@ -1853,7 +1853,7 @@ float WinningCondition_Scores(float limit, float leadlimit)
        if(WinningConditionHelper_zeroisworst)
                leadlimit = 0; // not supported in this mode
 
-       if(g_dm || g_tdm || g_ca || (g_race && !g_race_qualifying) || g_nexball)
+       if(g_dm || g_tdm || g_ca || g_freezetag || (g_race && !g_race_qualifying) || g_nexball)
        // these modes always score in increments of 1, thus this makes sense
        {
                if(leaderfrags != WinningConditionHelper_topscore)
index e7e771dc6ed03a26ff89f050aa1499ff2fc835ad..3f312a203a459622e9a38e958ee5f2f7e012ddc1 100644 (file)
@@ -1722,7 +1722,7 @@ float SUB_NoImpactCheck()
        if(trace_dphitcontents == 0)
        {
                //dprint("A hit happened with zero hit contents... DEBUG THIS, this should never happen for projectiles! Projectile will self-destruct.\n");
-               dprint(sprintf("A hit from a projectile happened with no hit contents! DEBUG THIS, this should never happen for projectiles! Profectile will self-destruct. (edict: %d, classname: %s, origin: %s)\n", num_for_edict(self), self.classname, vtos(self.origin)));
+               dprintf("A hit from a projectile happened with no hit contents! DEBUG THIS, this should never happen for projectiles! Profectile will self-destruct. (edict: %d, classname: %s, origin: %s)\n", num_for_edict(self), self.classname, vtos(self.origin));
                checkclient();
        }
     if (trace_dphitq3surfaceflags & Q3SURFACEFLAG_NOIMPACT)
@@ -2011,65 +2011,6 @@ float MoveToRandomMapLocation(entity e, float goodcontents, float badcontents, f
         return FALSE;
 }
 
-float zcurveparticles_effectno;
-vector zcurveparticles_start;
-float zcurveparticles_spd;
-
-void endzcurveparticles()
-{
-       if(zcurveparticles_effectno)
-       {
-               // terminator
-               WriteShort(MSG_BROADCAST, zcurveparticles_spd | 0x8000);
-       }
-       zcurveparticles_effectno = 0;
-}
-
-void zcurveparticles(float effectno, vector start, vector end, float end_dz, float spd)
-{
-       spd = bound(0, floor(spd / 16), 32767);
-       if(effectno != zcurveparticles_effectno || start != zcurveparticles_start)
-       {
-               endzcurveparticles();
-               WriteByte(MSG_BROADCAST, SVC_TEMPENTITY);
-               WriteByte(MSG_BROADCAST, TE_CSQC_ZCURVEPARTICLES);
-               WriteShort(MSG_BROADCAST, effectno);
-               WriteCoord(MSG_BROADCAST, start_x);
-               WriteCoord(MSG_BROADCAST, start_y);
-               WriteCoord(MSG_BROADCAST, start_z);
-               zcurveparticles_effectno = effectno;
-               zcurveparticles_start = start;
-       }
-       else
-               WriteShort(MSG_BROADCAST, zcurveparticles_spd);
-       WriteCoord(MSG_BROADCAST, end_x);
-       WriteCoord(MSG_BROADCAST, end_y);
-       WriteCoord(MSG_BROADCAST, end_z);
-       WriteCoord(MSG_BROADCAST, end_dz);
-       zcurveparticles_spd = spd;
-}
-
-void zcurveparticles_from_tracetoss(float effectno, vector start, vector end, vector vel)
-{
-       float end_dz;
-       vector vecxy, velxy;
-
-       vecxy = end - start;
-       vecxy_z = 0;
-       velxy = vel;
-       velxy_z = 0;
-
-       if (vlen(velxy) < 0.000001 * fabs(vel_z))
-       {
-               endzcurveparticles();
-               trailparticles(world, effectno, start, end);
-               return;
-       }
-
-       end_dz = vlen(vecxy) / vlen(velxy) * vel_z - (end_z - start_z);
-       zcurveparticles(effectno, start, end, end_dz, vlen(vel));
-}
-
 void write_recordmarker(entity pl, float tstart, float dt)
 {
     GameLogEcho(strcat(":recordset:", ftos(pl.playerid), ":", ftos(dt)));
index 0325067f28fb396d795c693ba8608524ba473dc1..60df95a006eab4ce0941dc2176d43216e0cda9a7 100644 (file)
@@ -212,31 +212,8 @@ void assault_wall_think()
 
 // trigger new round
 // reset objectives, toggle spawnpoints, reset triggers, ...
-void vehicles_clearrturn();
-void vehicles_spawn();
 void assault_new_round()
 {
-    entity oldself;
-       //bprint("ASSAULT: new round\n");
-
-       oldself = self;
-       // Eject players from vehicles
-    FOR_EACH_PLAYER(self)
-    {
-        if(self.vehicle)
-            vehicles_exit(VHEF_RELESE);
-    }
-
-    self = findchainflags(vehicle_flags, VHF_ISVEHICLE);
-    while(self)
-    {
-        vehicles_clearrturn();
-        vehicles_spawn();
-        self = self.chain;
-    }
-
-    self = oldself;
-
        // up round counter
        self.winning = self.winning + 1;
 
index 9fbd483cabacd754e3fc22063d322533923aa9ae..9df6b42a219645e9f0d09a959dba94211bdb2108 100644 (file)
@@ -144,6 +144,7 @@ MUTATOR_HOOKFUNCTION(ca_PutClientInServer)
        if(!allowed_to_spawn)
        {
                self.classname = "observer";
+               if(self.jointime != time) //not when connecting
                if(!self.caplayer)
                {
                        self.caplayer = 0.5;
@@ -158,6 +159,7 @@ MUTATOR_HOOKFUNCTION(ca_reset_map_players)
 {
        FOR_EACH_CLIENT(self)
        {
+               self.killcount = 0;
                if(self.caplayer)
                {
                        self.classname = "player";
@@ -182,12 +184,8 @@ MUTATOR_HOOKFUNCTION(ca_reset_map_global)
 
 MUTATOR_HOOKFUNCTION(ca_GetTeamCount)
 {
-       ca_teams = autocvar_g_ca_teams_override;
-       if(ca_teams < 2)
-               ca_teams = autocvar_g_ca_teams;
-       ca_teams = bound(2, ca_teams, 4);
        ret_float = ca_teams;
-       return 1;
+       return 0;
 }
 
 MUTATOR_HOOKFUNCTION(ca_PlayerDies)
@@ -224,16 +222,14 @@ MUTATOR_HOOKFUNCTION(ca_GiveFragsForKill)
 
 MUTATOR_HOOKFUNCTION(ca_SetStartItems)
 {
-       start_health = cvar("g_lms_start_health");
-       start_armorvalue = cvar("g_lms_start_armor");
-
-       start_ammo_shells = cvar("g_lms_start_ammo_shells");
-       start_ammo_nails = cvar("g_lms_start_ammo_nails");
-       start_ammo_rockets = cvar("g_lms_start_ammo_rockets");
-       start_ammo_cells = cvar("g_lms_start_ammo_cells");
-       start_ammo_fuel = cvar("g_lms_start_ammo_fuel");
-
        start_items &= ~IT_UNLIMITED_AMMO;
+       start_health       = warmup_start_health       = cvar("g_lms_start_health");
+       start_armorvalue   = warmup_start_armorvalue   = cvar("g_lms_start_armor");
+       start_ammo_shells  = warmup_start_ammo_shells  = cvar("g_lms_start_ammo_shells");
+       start_ammo_nails   = warmup_start_ammo_nails   = cvar("g_lms_start_ammo_nails");
+       start_ammo_rockets = warmup_start_ammo_rockets = cvar("g_lms_start_ammo_rockets");
+       start_ammo_cells   = warmup_start_ammo_cells   = cvar("g_lms_start_ammo_cells");
+       start_ammo_fuel    = warmup_start_ammo_fuel    = cvar("g_lms_start_ammo_fuel");
 
        return 0;
 }
@@ -272,23 +268,17 @@ MUTATOR_HOOKFUNCTION(ca_PlayerDamage_SplitHealthArmor)
        return FALSE;
 }
 
-// scoreboard setup
-void ca_ScoreRules()
-{
-       ScoreRules_basics(2, SFL_SORT_PRIO_PRIMARY, 0, TRUE);
-       ScoreInfo_SetLabel_TeamScore  (ST_CA_ROUNDS,    "rounds",    SFL_SORT_PRIO_PRIMARY);
-       ScoreRules_basics_end();
-}
-
-void ca_DelayedInit() // Do this check with a delay so we can wait for teams to be set up.
-{
-       ca_ScoreRules();
-}
-
 void ca_Initialize()
 {
        allowed_to_spawn = TRUE;
 
+       ca_teams = autocvar_g_ca_teams_override;
+       if(ca_teams < 2)
+               ca_teams = autocvar_g_ca_teams;
+       ca_teams = bound(2, ca_teams, 4);
+       ret_float = ca_teams;
+       ScoreRules_ca(ca_teams);
+
        round_handler_Spawn(CA_CheckTeams, CA_CheckWinner, CA_RoundStart);
        round_handler_Init(5, autocvar_g_ca_warmup, autocvar_g_ca_round_timelimit);
 
@@ -296,8 +286,6 @@ void ca_Initialize()
        addstat(STAT_BLUEALIVE, AS_INT, bluealive_stat);
        addstat(STAT_YELLOWALIVE, AS_INT, yellowalive_stat);
        addstat(STAT_PINKALIVE, AS_INT, pinkalive_stat);
-
-       InitializeEntity(world, ca_DelayedInit, INITPRIO_GAMETYPE);
 }
 
 MUTATOR_DEFINITION(gamemode_ca)
index a33395254bef0a82abefaebe7ed17b88d9c3b426..a7c1edfc53870a43666b596eac2f533dc2ebab7b 100644 (file)
@@ -1,8 +1,2 @@
 // should be removed in the future, as other code should not have to care
 .float caplayer; // 0.5 if scheduled to join the next round
-
-#ifdef SVQC
-
-#define ST_CA_ROUNDS 1
-
-#endif
index 9bc06522374aaae4e22b810d3c1a73afbaf3b46c..bfc2601e9a8884a06203f5215a2a530c62142a66 100644 (file)
@@ -100,7 +100,10 @@ float freezetag_CheckWinner()
                Send_Notification(NOTIF_ALL, world, MSG_CENTER, CENTER_ROUND_OVER);
                Send_Notification(NOTIF_ALL, world, MSG_INFO, INFO_ROUND_OVER);
                FOR_EACH_PLAYER(e)
+               {
                        e.freezetag_frozen_timeout = 0;
+                       e.freezetag_revive_progress = 0;
+               }
                round_handler_Init(5, autocvar_g_freezetag_warmup, autocvar_g_freezetag_round_timelimit);
                return 1;
        }
@@ -123,7 +126,10 @@ float freezetag_CheckWinner()
        }
 
        FOR_EACH_PLAYER(e)
+       {
                e.freezetag_frozen_timeout = 0;
+               e.freezetag_revive_progress = 0;
+       }
        round_handler_Init(5, autocvar_g_freezetag_warmup, autocvar_g_freezetag_round_timelimit);
        return 1;
 }
@@ -401,6 +407,7 @@ MUTATOR_HOOKFUNCTION(freezetag_reset_map_players)
 {
        FOR_EACH_PLAYER(self)
        {
+               self.killcount = 0;
                if (self.freezetag_frozen)
                        freezetag_Unfreeze(world);
                self.freezetag_frozen_timeout = -1;
@@ -468,7 +475,10 @@ MUTATOR_HOOKFUNCTION(freezetag_PlayerPreThink)
        if(n && self.freezetag_frozen) // OK, there is at least one teammate reviving us
        {
                self.freezetag_revive_progress = bound(0, self.freezetag_revive_progress + frametime * max(1/60, autocvar_g_freezetag_revive_speed), 1);
-               self.health = max(1, self.freezetag_revive_progress * autocvar_g_balance_health_start);
+               if(warmup_stage)
+                       self.health = max(1, self.freezetag_revive_progress * warmup_start_health);
+               else
+                       self.health = max(1, self.freezetag_revive_progress * start_health);
 
                if(self.freezetag_revive_progress >= 1)
                {
@@ -509,7 +519,10 @@ MUTATOR_HOOKFUNCTION(freezetag_PlayerPreThink)
        else if(!n && self.freezetag_frozen) // only if no teammate is nearby will we reset
        {
                self.freezetag_revive_progress = bound(0, self.freezetag_revive_progress - frametime * autocvar_g_freezetag_revive_clearspeed, 1);
-               self.health = max(1, self.freezetag_revive_progress * autocvar_g_balance_health_start);
+               if(warmup_stage)
+                       self.health = max(1, self.freezetag_revive_progress * warmup_start_health);
+               else
+                       self.health = max(1, self.freezetag_revive_progress * start_health);
        }
        else if(!n)
        {
@@ -602,10 +615,6 @@ MUTATOR_HOOKFUNCTION(freezetag_SpectateCopy)
 
 MUTATOR_HOOKFUNCTION(freezetag_GetTeamCount)
 {
-       freezetag_teams = autocvar_g_freezetag_teams_override;
-       if(freezetag_teams < 2)
-               freezetag_teams = autocvar_g_freezetag_teams;
-       freezetag_teams = bound(2, freezetag_teams, 4);
        ret_float = freezetag_teams;
        return 0;
 }
@@ -621,7 +630,12 @@ MUTATOR_HOOKFUNCTION(freezetag_VehicleTouch)
 void freezetag_Initialize()
 {
        precache_model("models/ice/ice.md3");
-       ScoreRules_freezetag();
+
+       freezetag_teams = autocvar_g_freezetag_teams_override;
+       if(freezetag_teams < 2)
+               freezetag_teams = autocvar_g_freezetag_teams;
+       freezetag_teams = bound(2, freezetag_teams, 4);
+       ScoreRules_freezetag(freezetag_teams);
 
        round_handler_Spawn(freezetag_CheckTeams, freezetag_CheckWinner, func_null);
        round_handler_Init(5, autocvar_g_freezetag_warmup, autocvar_g_freezetag_round_timelimit);
index 928c78b349470e078d3f22eacf4a2ffb377cd6b0..e782fbf7b7e18c5ded767c0105b660f6030afeba 100644 (file)
@@ -122,13 +122,13 @@ MUTATOR_HOOKFUNCTION(lms_GiveFragsForKill)
 MUTATOR_HOOKFUNCTION(lms_SetStartItems)
 {
        start_items &= ~IT_UNLIMITED_AMMO;
-       start_ammo_shells = cvar("g_lms_start_ammo_shells");
-       start_ammo_nails = cvar("g_lms_start_ammo_nails");
-       start_ammo_rockets = cvar("g_lms_start_ammo_rockets");
-       start_ammo_cells = cvar("g_lms_start_ammo_cells");
-       start_ammo_fuel = cvar("g_lms_start_ammo_fuel");
-       start_health = cvar("g_lms_start_health");
-       start_armorvalue = cvar("g_lms_start_armor");
+       start_health       = warmup_start_health       = cvar("g_lms_start_health");
+       start_armorvalue   = warmup_start_armorvalue   = cvar("g_lms_start_armor");
+       start_ammo_shells  = warmup_start_ammo_shells  = cvar("g_lms_start_ammo_shells");
+       start_ammo_nails   = warmup_start_ammo_nails   = cvar("g_lms_start_ammo_nails");
+       start_ammo_rockets = warmup_start_ammo_rockets = cvar("g_lms_start_ammo_rockets");
+       start_ammo_cells   = warmup_start_ammo_cells   = cvar("g_lms_start_ammo_cells");
+       start_ammo_fuel    = warmup_start_ammo_fuel    = cvar("g_lms_start_ammo_fuel");
 
        return FALSE;
 }
index b57666a6899ece808ef529f8267a721c2da41ee0..c55195c8375597551638a1e6ee4a1cbef561e1f6 100644 (file)
@@ -106,12 +106,18 @@ void ScoreRules_nexball(float teams)
        ScoreRules_basics_end();
 }
 
-// FreezeTag stuff
 #define SP_FREEZETAG_REVIVALS 4
-void ScoreRules_freezetag()
+void ScoreRules_freezetag(float teams)
 {
-       CheckAllowedTeams(world);
-       ScoreRules_basics(((c4>=0) ? 4 : (c3>=0) ? 3 : 2), SFL_SORT_PRIO_PRIMARY, SFL_SORT_PRIO_PRIMARY, TRUE); // SFL_SORT_PRIO_PRIMARY
+       ScoreRules_basics(teams, SFL_SORT_PRIO_PRIMARY, SFL_SORT_PRIO_PRIMARY, TRUE); // SFL_SORT_PRIO_PRIMARY
        ScoreInfo_SetLabel_PlayerScore(SP_FREEZETAG_REVIVALS,           "revivals",             0);
        ScoreRules_basics_end();
 }
+
+#define ST_CA_ROUNDS 1
+void ScoreRules_ca(float teams)
+{
+       ScoreRules_basics(teams, SFL_SORT_PRIO_PRIMARY, 0, TRUE);
+       ScoreInfo_SetLabel_TeamScore(ST_CA_ROUNDS, "rounds", SFL_SORT_PRIO_PRIMARY);
+       ScoreRules_basics_end();
+}
index 5185b2c611a639093d1f343911182e98d8009cf3..49e824ff0ddaecac78580cb648df75d026f9fc53 100644 (file)
@@ -121,6 +121,8 @@ void InitGameplayMode()
                fraglimit_override = autocvar_g_ca_point_limit;
                leadlimit_override = autocvar_g_ca_point_leadlimit;
                MUTATOR_ADD(gamemode_ca);
+               if(autocvar_g_ca_team_spawns)
+                       have_team_spawns = -1; // request team spawns
        }
 
        if(g_keyhunt)
@@ -137,6 +139,8 @@ void InitGameplayMode()
                fraglimit_override = autocvar_g_freezetag_point_limit;
                leadlimit_override = autocvar_g_freezetag_point_leadlimit;
                MUTATOR_ADD(gamemode_freezetag);
+               if(autocvar_g_freezetag_team_spawns)
+                       have_team_spawns = -1; // request team spawns
        }
 
        if(g_assault)
index 46c46d7f8f04068e7dba48f4b5f1e59320388385..eccc37f03f1ad1c8e56db6f2effde36f6b6aada4 100644 (file)
@@ -5,8 +5,7 @@ void turret_machinegun_attack();
 //.float bulletcounter;
 void turret_machinegun_attack()
 {
-    fireBallisticBullet (self.tur_shotorg, self.tur_shotdir_updated,self.shot_spread, self.shot_speed, 5, self.shot_dmg, self.shot_force, DEATH_TURRET_MACHINEGUN, 0, autocvar_g_balance_uzi_bulletconstant);
-    endFireBallisticBullet();
+    fireBullet (self.tur_shotorg, self.tur_shotdir_updated,self.shot_spread, 0, self.shot_dmg, self.shot_force, DEATH_TURRET_MACHINEGUN, 0);
 
     UziFlash();
     setattachment(self.muzzle_flash, self.tur_head, "tag_fire");
index 1ce59dd278bfb4e3bc2c5d84a9584bde94b212b2..2eeb08b8fda73978203dbac137b578d5e96e3e58 100644 (file)
@@ -515,8 +515,7 @@ void walker_postthink()
 void walker_attack()
 {
     sound (self, CH_WEAPON_A, "weapons/uzi_fire.wav", VOL_BASE, ATTEN_NORM);
-    fireBallisticBullet (self.tur_shotorg, self.tur_shotdir_updated, self.shot_spread, self.shot_speed, 5, self.shot_dmg, self.shot_force, DEATH_TURRET_WALK_GUN, 0, autocvar_g_balance_uzi_bulletconstant);
-    endFireBallisticBullet();
+    fireBullet (self.tur_shotorg, self.tur_shotdir_updated, self.shot_spread, 0, self.shot_dmg, self.shot_force, DEATH_TURRET_WALK_GUN, 0);
     pointparticles(particleeffectnum("laser_muzzleflash"), self.tur_shotorg, self.tur_shotdir_updated * 1000, 1);
 }
 
index bc5f03d8ae52f53d01bcdf33f51f6243974b98bd..657d227051e45cbe4da2d2e8df4295f3db36aba0 100644 (file)
@@ -792,10 +792,8 @@ void bumb_die()
 
 void bumb_impact()
 {
-    if(autocvar_g_vehicle_bumblebee_bouncepain_x)
-        vehilces_impact(autocvar_g_vehicle_bumblebee_bouncepain_x,
-                                               autocvar_g_vehicle_bumblebee_bouncepain_y,
-                                               autocvar_g_vehicle_bumblebee_bouncepain_z);
+       if(autocvar_g_vehicle_bumblebee_bouncepain_x)
+               vehicles_impact(autocvar_g_vehicle_bumblebee_bouncepain_x, autocvar_g_vehicle_bumblebee_bouncepain_y, autocvar_g_vehicle_bumblebee_bouncepain_z);
 }
 
 void bumb_spawn(float _f)
index ff54539027eaa8cebb27d1f45caa6101a11e6046..f009723b7f223103b3848b8ad05fc8bc84ae4ae1 100644 (file)
@@ -74,7 +74,6 @@ 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_default();
 
 void racer_align4point(float _delta)
 {
@@ -529,8 +528,8 @@ void racer_exit(float eject)
 
 void racer_impact()
 {
-    if(autocvar_g_vehicle_racer_bouncepain_x)
-        vehilces_impact(autocvar_g_vehicle_racer_bouncepain_x, autocvar_g_vehicle_racer_bouncepain_y, autocvar_g_vehicle_racer_bouncepain_z);
+       if(autocvar_g_vehicle_racer_bouncepain_x)
+               vehicles_impact(autocvar_g_vehicle_racer_bouncepain_x, autocvar_g_vehicle_racer_bouncepain_y, autocvar_g_vehicle_racer_bouncepain_z);
 }
 
 void racer_blowup()
@@ -544,16 +543,16 @@ void racer_blowup()
                                        autocvar_g_vehicle_racer_blowup_forceintensity,
                                        DEATH_VH_WAKI_DEATH, world);
 
-    self.nextthink  = time + autocvar_g_vehicle_racer_respawntime;
-    self.think      = racer_spawn_default;
+       self.alpha      = -1;
     self.movetype   = MOVETYPE_NONE;
     self.effects    = EF_NODRAW;
-
     self.colormod  = '0 0 0';
     self.avelocity = '0 0 0';
     self.velocity  = '0 0 0';
 
     setorigin(self, self.pos1);
+       self.touch = func_null;
+       self.nextthink = 0;
 }
 
 void racer_deadtouch()
@@ -624,12 +623,6 @@ void racer_spawn(float _spawnflag)
     self.damageforcescale = 0.5;
     //self.destvec = autocvar_g_vehicle_racer_bouncepain;
 }
-void racer_spawn_default()
-{
-       racer_spawn(0);
-}
-
-
 
 void spawnfunc_vehicle_racer()
 {
index 58a640e9cf8672afe3d0861b7c572f4ad4617bd9..a6ef526499528839ee09194e3b0fbd73bc5cee1c 100644 (file)
@@ -70,6 +70,11 @@ float autocvar_g_vehicle_raptor_shield;
 float autocvar_g_vehicle_raptor_shield_regen;
 float autocvar_g_vehicle_raptor_shield_regen_pause;
 
+float autocvar_g_vehicle_raptor_blowup_radius;
+float autocvar_g_vehicle_raptor_blowup_coredamage;
+float autocvar_g_vehicle_raptor_blowup_edgedamage;
+float autocvar_g_vehicle_raptor_blowup_forceintensity;
+
 float autocvar_g_vehicle_raptor_bouncefactor;
 float autocvar_g_vehicle_raptor_bouncestop;
 vector autocvar_g_vehicle_raptor_bouncepain;
@@ -690,7 +695,10 @@ void raptor_blowup()
 {
     self.deadflag    = DEAD_DEAD;
     self.vehicle_exit(VHEF_NORMAL);
-    RadiusDamage (self, self.enemy, 250, 15, 250, world, 250, DEATH_VH_RAPT_DEATH, world);
+       RadiusDamage(self, self.enemy, autocvar_g_vehicle_raptor_blowup_coredamage,
+                               autocvar_g_vehicle_raptor_blowup_edgedamage,
+                               autocvar_g_vehicle_raptor_blowup_radius, world,
+                               autocvar_g_vehicle_raptor_blowup_forceintensity, DEATH_VH_RAPT_DEATH, world);
 
     self.alpha          = -1;
     self.movetype       = MOVETYPE_NONE;
@@ -742,8 +750,8 @@ void raptor_die()
 
 void raptor_impact()
 {
-    if(autocvar_g_vehicle_raptor_bouncepain_x)
-        vehilces_impact(autocvar_g_vehicle_raptor_bouncepain_x, autocvar_g_vehicle_raptor_bouncepain_y, autocvar_g_vehicle_raptor_bouncepain_z);
+       if(autocvar_g_vehicle_raptor_bouncepain_x)
+               vehicles_impact(autocvar_g_vehicle_raptor_bouncepain_x, autocvar_g_vehicle_raptor_bouncepain_y, autocvar_g_vehicle_raptor_bouncepain_z);
 }
 
 // If we dont do this ever now and then, the raptors rotors
@@ -798,7 +806,7 @@ void raptor_spawn(float _f)
         //FIXME: Camera is in a bad place in HUD model.
         //setorigin(self.vehicle_viewport, '25 0 5');
 
-        self.vehicles_impusle   = raptor_impulse;
+        self.vehicles_impulse   = raptor_impulse;
 
         self.frame = 0;
 
index bdbcb828870829577254ea87fe569ad792acd51a..1085a904e2143f7e1abec373b6f4d80aa496cad7 100644 (file)
@@ -43,8 +43,7 @@ float autocvar_g_vehicle_spiderbot_minigun_ammo_max;
 float autocvar_g_vehicle_spiderbot_minigun_ammo_regen;
 float autocvar_g_vehicle_spiderbot_minigun_ammo_regen_pause;
 float autocvar_g_vehicle_spiderbot_minigun_force;
-float autocvar_g_vehicle_spiderbot_minigun_speed;
-float autocvar_g_vehicle_spiderbot_minigun_bulletconstant;
+float autocvar_g_vehicle_spiderbot_minigun_solidpenetration;
 
 float autocvar_g_vehicle_spiderbot_rocket_damage;
 float autocvar_g_vehicle_spiderbot_rocket_force;
@@ -59,6 +58,11 @@ float autocvar_g_vehicle_spiderbot_rocket_noise;
 float autocvar_g_vehicle_spiderbot_rocket_turnrate;
 float autocvar_g_vehicle_spiderbot_rocket_lifetime;
 
+float autocvar_g_vehicle_spiderbot_blowup_radius;
+float autocvar_g_vehicle_spiderbot_blowup_coredamage;
+float autocvar_g_vehicle_spiderbot_blowup_edgedamage;
+float autocvar_g_vehicle_spiderbot_blowup_forceintensity;
+
 vector autocvar_g_vehicle_spiderbot_bouncepain;
 
 
@@ -495,12 +499,8 @@ float spiderbot_frame()
             v_forward = normalize(v_forward);
             v += v_forward * 50;
 
-//void fireBallisticBullet(vector start, vector dir, float spread, float pSpeed, float lifetime, float damage, float force, float dtype, float tracereffects, float bulletconstant)
-
-            fireBallisticBullet(v, v_forward, autocvar_g_vehicle_spiderbot_minigun_spread, autocvar_g_vehicle_spiderbot_minigun_speed,
-                                5, autocvar_g_vehicle_spiderbot_minigun_damage, autocvar_g_vehicle_spiderbot_minigun_force, DEATH_VH_SPID_MINIGUN, 0, autocvar_g_vehicle_spiderbot_minigun_bulletconstant);
-
-            endFireBallisticBullet();
+            fireBullet(v, v_forward, autocvar_g_vehicle_spiderbot_minigun_spread, autocvar_g_vehicle_spiderbot_minigun_solidpenetration,
+                                autocvar_g_vehicle_spiderbot_minigun_damage, autocvar_g_vehicle_spiderbot_minigun_force, DEATH_VH_SPID_MINIGUN, 0);
 
 //            fireBullet (v, v_forward, autocvar_g_vehicle_spiderbot_minigun_spread, autocvar_g_vehicle_spiderbot_minigun_damage,
 //                autocvar_g_vehicle_spiderbot_minigun_spread, DEATH_VH_SPID_MINIGUN, 0);
@@ -639,8 +639,8 @@ void spiderbot_exit(float eject)
 
 void spider_impact()
 {
-    if(autocvar_g_vehicle_spiderbot_bouncepain_x)
-        vehilces_impact(autocvar_g_vehicle_spiderbot_bouncepain_x, autocvar_g_vehicle_spiderbot_bouncepain_y, autocvar_g_vehicle_spiderbot_bouncepain_z);
+       if(autocvar_g_vehicle_spiderbot_bouncepain_x)
+               vehicles_impact(autocvar_g_vehicle_spiderbot_bouncepain_x, autocvar_g_vehicle_spiderbot_bouncepain_y, autocvar_g_vehicle_spiderbot_bouncepain_z);
 }
 
 void spiderbot_headfade()
@@ -723,14 +723,18 @@ void spiderbot_blowup()
     SUB_SetFade(g1, time, min(autocvar_g_vehicle_spiderbot_respawntime, 10));
     SUB_SetFade(g2, time, min(autocvar_g_vehicle_spiderbot_respawntime, 10));
 
-    RadiusDamage (self, self.enemy, 250, 15, 250, world, 250, DEATH_VH_SPID_DEATH, world);
+       RadiusDamage(self, self.enemy, autocvar_g_vehicle_spiderbot_blowup_coredamage,
+                               autocvar_g_vehicle_spiderbot_blowup_edgedamage,
+                               autocvar_g_vehicle_spiderbot_blowup_radius, world,
+                               autocvar_g_vehicle_spiderbot_blowup_forceintensity, DEATH_VH_SPID_DEATH, world);
 
     self.alpha = self.tur_head.alpha = self.gun1.alpha = self.gun2.alpha = -1;
     self.movetype   = MOVETYPE_NONE;
     self.deadflag   = DEAD_DEAD;
     self.solid      = SOLID_NOT;
     self.tur_head.effects  &=  ~EF_FLAME;
-    self.vehicle_hudmodel.viewmodelforclient = self;
+       self.vehicle_hudmodel.viewmodelforclient = self;
+       setorigin(self, self.pos1);
 }
 
 void spiderbot_die()
@@ -789,7 +793,7 @@ void spiderbot_spawn(float _f)
 {
     if(!self.gun1)
     {
-        self.vehicles_impusle   = spiderbot_impulse;
+        self.vehicles_impulse   = spiderbot_impulse;
         self.gun1               = spawn();
         self.gun2               = spawn();
         setmodel(self.gun1, "models/vehicles/spiderbot_barrels.dpm");
index 1e5537a259934cd2faab7750716d1b9d57ea22de..b9740b5d88bfa5bee49fc6589962ef61298ed672 100644 (file)
@@ -16,7 +16,7 @@ void vehicles_return();
 void vehicles_enter();
 void vehicles_touch();
 void vehicles_reset_colors();
-void vehicles_clearrturn();
+void vehicles_clearreturn();
 void vehicles_setreturn();
 
 
@@ -456,6 +456,30 @@ entity vehicles_projectile(string _mzlfx, string _mzlsound,
 }
 // End generic vehile projectile system
 
+void vehicles_reset()
+{
+       if(self.owner)
+       {
+               entity oldself = self;
+               self = self.owner;
+               vehicles_exit(VHEF_RELESE);
+               self = oldself;
+       }
+       self.alpha      = -1;
+       self.movetype   = MOVETYPE_NONE;
+       self.effects    = EF_NODRAW;
+       self.colormod  = '0 0 0';
+       self.avelocity = '0 0 0';
+       self.velocity  = '0 0 0';
+       self.event_damage = func_null;
+       self.solid = SOLID_NOT;
+       self.deadflag = DEAD_NO;
+
+       self.touch = func_null;
+       self.nextthink = 0;
+       vehicles_setreturn();
+}
+
 /** vehicles_spawn
     Exetuted for all vehicles on (re)spawn.
     Sets defaults for newly spawned units.
@@ -470,6 +494,7 @@ void vehicles_spawn()
     self.owner              = world;
     self.touch              = vehicles_touch;
     self.event_damage       = vehicles_damage;
+    self.reset              = vehicles_reset;
     self.iscreature         = TRUE;
     self.teleportable       = FALSE; // no teleporting for vehicles, too buggy
     self.damagedbycontents     = TRUE;
@@ -512,7 +537,7 @@ float vehicles_crushable(entity e)
     return FALSE;
 }
 
-void vehilces_impact(float _minspeed, float _speedfac, float _maxpain)
+void vehicles_impact(float _minspeed, float _speedfac, float _maxpain)
 {
     if (trace_dphitq3surfaceflags & Q3SURFACEFLAG_NOIMPACT)
         return;
@@ -658,7 +683,7 @@ void vehicles_enter()
         }
     }
 
-    vehicles_clearrturn();
+    vehicles_clearreturn();
 
     CSQCVehicleSetup(self.owner, self.hud);
 
@@ -964,7 +989,7 @@ void vehicles_damage(entity inflictor, entity attacker, float damage, float deat
     }
 }
 
-void vehicles_clearrturn()
+void vehicles_clearreturn()
 {
     entity ret;
     // Remove "return helper", if any.
@@ -1055,7 +1080,7 @@ void vehicles_setreturn()
 {
     entity ret;
 
-    vehicles_clearrturn();
+    vehicles_clearreturn();
 
     ret = spawn();
     ret.classname   = "vehicle_return";
@@ -1063,19 +1088,16 @@ void vehicles_setreturn()
     ret.team        = self.team;
     ret.think       = vehicles_showwp;
 
-    if(self.deadflag != DEAD_NO)
-    {
-        ret.cnt         = time + self.vehicle_respawntime;
-        ret.nextthink   = min(time + self.vehicle_respawntime, time + self.vehicle_respawntime - 5);
-    }
-    else
-    {
-        ret.nextthink   = min(time + self.vehicle_respawntime, time + self.vehicle_respawntime - 1);
-    }
+       if(self.deadflag != DEAD_NO)
+       {
+               ret.cnt = max(game_starttime, time) + self.vehicle_respawntime;
+               ret.nextthink = max(game_starttime, time) + max(0, self.vehicle_respawntime - 5);
+       }
+       else
+               ret.nextthink = max(game_starttime, time) + max(0, self.vehicle_respawntime - 1);
 
     setmodel(ret, "null");
     setorigin(ret, self.pos1 + '0 0 96');
-
 }
 
 void vehicles_reset_colors()
@@ -1273,15 +1295,14 @@ float vehicle_initialize(string  net_name,
     self.event_damage        = func_null;
     self.touch               = vehicles_touch;
     self.think               = vehicles_spawn;
-    self.nextthink           = time;
-    self.vehicle_respawntime = _respawntime;
     self.vehicle_spawn       = spawnproc;
+       self.vehicle_respawntime = max(0, _respawntime);
     self.effects             = EF_NODRAW;
        self.dphitcontentsmask   = DPCONTENTS_BODY | DPCONTENTS_SOLID;
-    if(!autocvar_g_vehicles_delayspawn)
-        self.nextthink = time + game_starttime;
-    else
-        self.nextthink = time + _respawntime + (random() * autocvar_g_vehicles_delayspawn_jitter);
+       if(!autocvar_g_vehicles_delayspawn || !self.vehicle_respawntime)
+               self.nextthink = time;
+       else
+               self.nextthink = max(time, game_starttime) + max(0, self.vehicle_respawntime + ((random() * 2 - 1) * autocvar_g_vehicles_delayspawn_jitter));
 
        if(autocvar_g_playerclip_collisions)
                self.dphitcontentsmask |= DPCONTENTS_PLAYERCLIP;
index 393563f18b51a0aced50c1734498493273d027f8..56fc9ea009e542fd219dcf1f42cc922c4ce86e5d 100644 (file)
@@ -62,11 +62,9 @@ const float SVC_UPDATEENTITY  = 128; // Net.Protocol 0x80
 #define VHSF_NORMAL 0
 #define VHSF_FACTORY 2
 .void(float _spawnflag) vehicle_spawn;  /// Vehicles custom fucntion to be efecuted when vehicle (re)spawns
-.float(float _imp) vehicles_impusle;
+.float(float _imp) vehicles_impulse;
 .float vehicle_weapon2mode = volly_counter;
 
-//§ .void() vehicle_factory()
-
 #ifdef VEHICLES_USE_ODE
 void(entity e, float physics_enabled) physics_enable = #540; // enable or disable physics on object
 void(entity e, vector force, vector force_pos) physics_addforce = #541; // apply a force from certain origin, length of force vector is power of force
index 72cac7985797445909ff04409d554f63b01ea8ff..f51db6dd5dc48708f8c7477804fea7179b30d811 100644 (file)
@@ -35,9 +35,6 @@ void FireRailgunBullet (vector start, vector end, float bdamage, float bforce, f
 
        pseudoprojectile = world;
 
-       railgun_start = start;
-       railgun_end = end;
-
        dir = normalize(end - start);
        length = vlen(end - start);
        force = dir * bforce;
@@ -165,328 +162,64 @@ void FireRailgunBullet (vector start, vector end, float bdamage, float bforce, f
        trace_dphitq3surfaceflags = endq3surfaceflags;
 }
 
-.float dmg_force;
-.float dmg_radius;
-.float dmg_total;
-//.float last_yoda;
-void W_BallisticBullet_Hit (void)
-{
-       float f, q, g;
-
-       f = pow(bound(0, vlen(self.velocity) / vlen(self.oldvelocity), 1), 2); // energy multiplier
-       q = 1 + self.dmg_edge / self.dmg;
-
-       if(other.solid == SOLID_BSP || other.solid == SOLID_SLIDEBOX)
-               Damage_DamageInfo(self.origin, self.dmg * f, 0, 0, max(1, self.dmg_force) * normalize(self.velocity) * f, self.projectiledeathtype, other.species, self);
-
-       if(other && other != self.enemy)
-       {
-               endzcurveparticles();
-
-               yoda = 0;
-               railgun_start = self.origin - 2 * frametime * self.velocity;
-               railgun_end = self.origin + 2 * frametime * self.velocity;
-               g = accuracy_isgooddamage(self.realowner, other);
-               Damage(other, self, self.realowner, self.dmg * f, self.projectiledeathtype, self.origin, self.dmg_force * normalize(self.velocity) * f);
-
-               /*if(yoda && (time > (self.last_yoda + 5)))
-               {
-                       Send_Notification(NOTIF_ONE, self.realowner, MSG_ANNCE, ANNCE_ACHIEVEMENT_YODA);
-                       self.last_yoda = time;
-               }*/
-
-               // calculate hits for ballistic weapons
-               if(g)
-               {
-                       // do not exceed 100%
-                       q = min(self.dmg * q, self.dmg_total + f * self.dmg) - self.dmg_total;
-                       self.dmg_total += f * self.dmg;
-                       accuracy_add(self.realowner, self.realowner.weapon, 0, q);
-               }
-       }
-
-       self.enemy = other; // don't hit the same player twice with the same bullet
-}
-
-.void(void) W_BallisticBullet_LeaveSolid_think_save;
-.float W_BallisticBullet_LeaveSolid_nextthink_save;
-.vector W_BallisticBullet_LeaveSolid_origin;
-.vector W_BallisticBullet_LeaveSolid_velocity;
-
-void W_BallisticBullet_LeaveSolid_think()
+float fireBullet_trace_callback_eff;
+entity fireBullet_last_hit;
+void fireBullet_trace_callback(vector start, vector hit, vector end)
 {
-       setorigin(self, self.W_BallisticBullet_LeaveSolid_origin);
-       self.velocity = self.W_BallisticBullet_LeaveSolid_velocity;
-
-       self.think = self.W_BallisticBullet_LeaveSolid_think_save;
-       self.nextthink = max(time, self.W_BallisticBullet_LeaveSolid_nextthink_save);
-       self.W_BallisticBullet_LeaveSolid_think_save = func_null;
-
-       self.flags &= ~FL_ONGROUND;
-
-       if(self.enemy.solid == SOLID_BSP)
-       {
-               float f;
-               f = pow(bound(0, vlen(self.velocity) / vlen(self.oldvelocity), 1), 2); // energy multiplier
-               Damage_DamageInfo(self.origin, 0, 0, 0, max(1, self.dmg_force) * normalize(self.velocity) * -f, self.projectiledeathtype, 0, self);
-       }
-
-       UpdateCSQCProjectile(self);
-}
-
-float W_BallisticBullet_LeaveSolid(float eff)
-{
-       // move the entity along its velocity until it's out of solid, then let it resume
-       vector vel = self.velocity;
-       float dt, dst, velfactor, v0, vs;
-       float maxdist;
-       float E0_m, Es_m;
-       float constant = self.dmg_radius * (other.ballistics_density ? other.ballistics_density : 1);
-
-       // outside the world? forget it
-       if(self.origin_x > world.maxs_x || self.origin_y > world.maxs_y || self.origin_z > world.maxs_z || self.origin_x < world.mins_x || self.origin_y < world.mins_y || self.origin_z < world.mins_z)
-               return 0;
-
-       // special case for zero density and zero bullet constant:
-
-       if(self.dmg_radius == 0)
-       {
-               if(other.ballistics_density < 0)
-                       constant = 0; // infinite travel distance
-               else
-                       return 0; // no penetration
-       }
-       else
-       {
-               if(other.ballistics_density < 0)
-                       constant = 0; // infinite travel distance
-               else if(other.ballistics_density == 0)
-                       constant = self.dmg_radius;
-               else
-                       constant = self.dmg_radius * other.ballistics_density;
-       }
-
-       // E(s) = E0 - constant * s, constant = area of bullet circle * material constant / mass
-       v0 = vlen(vel);
-
-       E0_m = 0.5 * v0 * v0;
-
-       if(constant)
-       {
-               maxdist = E0_m / constant;
-               // maxdist = 0.5 * v0 * v0 / constant
-               // dprint("max dist = ", ftos(maxdist), "\n");
-
-               if(maxdist <= autocvar_g_ballistics_mindistance)
-                       return 0;
-       }
-       else
-       {
-               maxdist = vlen(other.maxs - other.mins) + 1; // any distance, as long as we leave the entity
-       }
-
-       traceline_inverted (self.origin, self.origin + normalize(vel) * maxdist, MOVE_NORMAL, self, TRUE);
-       if(trace_fraction == 1) // 1: we never got out of solid
-               return 0;
-
-       self.W_BallisticBullet_LeaveSolid_origin = trace_endpos;
-
-       dst = max(autocvar_g_ballistics_mindistance, vlen(trace_endpos - self.origin));
-       // E(s) = E0 - constant * s, constant = area of bullet circle * material constant / mass
-       Es_m = E0_m - constant * dst;
-       if(Es_m <= 0)
-       {
-               // roundoff errors got us
-               return 0;
-       }
-       vs = sqrt(2 * Es_m);
-       velfactor = vs / v0;
-
-       dt = dst / (0.5 * (v0 + vs));
-       // this is not correct, but the differential equations have no analytic
-       // solution - and these times are very small anyway
-       //print("dt = ", ftos(dt), "\n");
-
-       self.W_BallisticBullet_LeaveSolid_think_save = self.think;
-       self.W_BallisticBullet_LeaveSolid_nextthink_save = self.nextthink;
-       self.think = W_BallisticBullet_LeaveSolid_think;
-       self.nextthink = time + dt;
-
-       vel = vel * velfactor;
-
-       self.velocity = '0 0 0';
-       self.flags |= FL_ONGROUND; // prevent moving
-       self.W_BallisticBullet_LeaveSolid_velocity = vel;
-
-       if(eff >= 0)
-               if(vlen(trace_endpos - self.origin) > 4)
-               {
-                       endzcurveparticles();
-                       trailparticles(self, eff, self.origin, trace_endpos);
-               }
-
-       return 1;
-}
-
-void W_BallisticBullet_Touch (void)
-{
-       //float density;
-
-       if(self.think == W_BallisticBullet_LeaveSolid_think) // skip this!
-               return;
-
-       PROJECTILE_TOUCH;
-       W_BallisticBullet_Hit ();
-
-       if(self.dmg_radius < 0) // these NEVER penetrate solid
-       {
-               remove(self);
-               return;
-       }
-
-       // if we hit "weapclip", bail out
-       //
-       // rationale of this check:
-       //
-       // any shader that is solid, nodraw AND trans is meant to clip weapon
-       // shots and players, but has no other effect!
-       //
-       // if it is not trans, it is caulk and should not have this side effect
-       //
-       // matching shaders:
-       //   common/weapclip (intended)
-       //   common/noimpact (is supposed to eat projectiles, but is erased farther above)
-       if(trace_dphitq3surfaceflags & Q3SURFACEFLAG_NODRAW)
-       if (!(trace_dphitq3surfaceflags & Q3SURFACEFLAG_NONSOLID))
-       if (!(trace_dphitcontents & DPCONTENTS_OPAQUE))
-       {
-               remove(self);
-               return;
-       }
-
-       // go through solid!
-       if(!W_BallisticBullet_LeaveSolid(-1))
-       {
-               remove(self);
-               return;
-       }
-
-       self.projectiledeathtype |= HITTYPE_BOUNCE;
-}
-
-void endFireBallisticBullet()
-{
-       endzcurveparticles();
-}
-
-entity fireBallisticBullet_trace_callback_ent;
-float fireBallisticBullet_trace_callback_eff;
-void fireBallisticBullet_trace_callback(vector start, vector hit, vector end)
-{
-       if(vlen(trace_endpos - fireBallisticBullet_trace_callback_ent.origin) > 16)
-               zcurveparticles_from_tracetoss(fireBallisticBullet_trace_callback_eff, fireBallisticBullet_trace_callback_ent.origin, trace_endpos, fireBallisticBullet_trace_callback_ent.velocity);
+       if(vlen(hit - start) > 16)
+               trailparticles(world, fireBullet_trace_callback_eff, start, hit);
        WarpZone_trace_forent = world;
-       self.owner = world;
+       fireBullet_last_hit = world;
 }
 
-void fireBallisticBullet(vector start, vector dir, float spread, float pSpeed, float lifetime, float damage, float force, float dtype, float tracereffects, float bulletconstant)
+void fireBullet(vector start, vector dir, float spread, float max_solid_penetration, float damage, float force, float dtype, float tracereffects)
 {
-       float lag, dt, savetime; //, density;
-       entity pl, oldself;
-
-       entity proj;
-       proj = spawn();
-       proj.classname = "bullet";
-       proj.owner = proj.realowner = self;
-       PROJECTILE_MAKETRIGGER(proj);
-       proj.movetype = MOVETYPE_FLY;
-       proj.think = SUB_Remove;
-       proj.nextthink = time + lifetime; // min(pLifetime, vlen(world.maxs - world.mins) / pSpeed);
-       W_SetupProjectileVelocityEx(proj, dir, v_up, pSpeed, 0, 0, spread, TRUE);
-       proj.angles = vectoangles(proj.velocity);
-       if(bulletconstant > 0)
-               proj.dmg_radius = autocvar_g_ballistics_materialconstant / bulletconstant;
-       else if(bulletconstant == 0)
-               proj.dmg_radius = 0;
-       else
-               proj.dmg_radius = -1;
-       // so: bulletconstant = bullet mass / area of bullet circle
-       setorigin(proj, start);
-       proj.flags = FL_PROJECTILE;
-
-       proj.touch = W_BallisticBullet_Touch;
-       proj.dmg = damage;
-       proj.dmg_force = force;
-       proj.projectiledeathtype = dtype;
-
-       proj.oldvelocity = proj.velocity;
+       // TODO antilag takeback
+       vector  end;
 
-       other = proj; MUTATOR_CALLHOOK(EditProjectile);
+       dir = normalize(dir + randomvec() * spread);
+       end = start + dir * MAX_SHOT_DISTANCE;
 
-       float eff;
+       entity pl;
+       fireBullet_last_hit = world;
+       float solid_penetration_left = 1;
+       float total_damage = 0;
 
        if(tracereffects & EF_RED)
-               eff = particleeffectnum("tr_rifle");
+               fireBullet_trace_callback_eff = particleeffectnum("tr_rifle");
        else if(tracereffects & EF_BLUE)
-               eff = particleeffectnum("tr_rifle_weak");
+               fireBullet_trace_callback_eff = particleeffectnum("tr_rifle_weak");
        else
-               eff = particleeffectnum("tr_bullet");
+               fireBullet_trace_callback_eff = particleeffectnum("tr_bullet");
 
-       // NOTE: this may severely throw off weapon balance
-       lag = ANTILAG_LATENCY(self);
+       float lag = ANTILAG_LATENCY(self);
        if(lag < 0.001)
                lag = 0;
        if (!IS_REAL_CLIENT(self))
                lag = 0;
        if(autocvar_g_antilag == 0 || self.cvar_cl_noantilag)
                lag = 0; // only do hitscan, but no antilag
-
        if(lag)
                FOR_EACH_PLAYER(pl)
                        if(pl != self)
                                antilag_takeback(pl, time - lag);
 
-       oldself = self;
-       self = proj;
-
-       savetime = frametime;
-       frametime = 0.05;
+       WarpZone_trace_forent = self;
 
-       for(;;)
+       for (;;)
        {
-               // DP tracetoss is stupid and always traces in 0.05s
-               // ticks. This makes it trace in 0.05*0.125s ticks
-               // instead.
-               vector v0;
-               v0 = self.velocity;
-               self.velocity = self.velocity * 0.125;
-               trace_fraction = 0;
-               fireBallisticBullet_trace_callback_ent = self;
-               fireBallisticBullet_trace_callback_eff = eff;
-               WarpZone_TraceToss_ThroughZone(self, self.owner, world, fireBallisticBullet_trace_callback);
-               self.velocity = v0;
-
-               if(trace_fraction == 1)
+               // TODO also show effect while tracing
+               WarpZone_TraceBox_ThroughZone(start, '0 0 0', '0 0 0', end, FALSE, WarpZone_trace_forent, world, fireBullet_trace_callback);
+               dir = WarpZone_TransformVelocity(WarpZone_trace_transform, dir);
+               end = WarpZone_TransformOrigin(WarpZone_trace_transform, end);
+               start = trace_endpos;
+               entity hit = trace_ent;
+
+               // When hitting sky, stop.
+               if (pointcontents(start) == CONTENT_SKY)
                        break;
-                       // won't hit anything anytime soon (DP's
-                       // tracetoss does 200 tics of, here,
-                       // 0.05*0.125s, that is, 1.25 seconds
-
-               other = trace_ent;
-               dt = WarpZone_tracetoss_time * 0.125; // this is only approximate!
-               setorigin(self, trace_endpos);
-               self.velocity = WarpZone_tracetoss_velocity * (1 / 0.125);
-
-               if(!SUB_OwnerCheck())
-               {
-                       if(SUB_NoImpactCheck())
-                               break;
-
-                       // hit the player
-                       W_BallisticBullet_Hit();
-               }
 
-               if(proj.dmg_radius < 0) // these NEVER penetrate solid
+               if (trace_dphitq3surfaceflags & Q3SURFACEFLAG_NOIMPACT)
                        break;
 
                // if we hit "weapclip", bail out
@@ -500,54 +233,79 @@ void fireBallisticBullet(vector start, vector dir, float spread, float pSpeed, f
                //
                // matching shaders:
                //   common/weapclip (intended)
-               //   common/noimpact (is supposed to eat projectiles, but is erased farther above)
+               //   common/noimpact (is supposed to eat projectiles, but is erased anyway)
+               float is_weapclip = 0;
                if(trace_dphitq3surfaceflags & Q3SURFACEFLAG_NODRAW)
                if (!(trace_dphitq3surfaceflags & Q3SURFACEFLAG_NONSOLID))
                if (!(trace_dphitcontents & DPCONTENTS_OPAQUE))
-                       break;
+                       is_weapclip = 1;
 
-               // go through solid!
-               if(!W_BallisticBullet_LeaveSolid((other && (other.solid != SOLID_BSP)) ? eff : -1))
-                       break;
+               if(!hit || hit.solid == SOLID_BSP || hit.solid == SOLID_SLIDEBOX)
+                       Damage_DamageInfo(start, damage * solid_penetration_left, 0, 0, max(1, force) * dir * solid_penetration_left, dtype, hit.species, self);
 
-               W_BallisticBullet_LeaveSolid_think();
+               if (hit && hit != WarpZone_trace_forent && hit != fireBullet_last_hit)  // Avoid self-damage (except after going through a warp); avoid hitting the same entity twice (engine bug).
+               {
+                       fireBullet_last_hit = hit;
+                       yoda = 0;
+                       float g = accuracy_isgooddamage(self, hit);
+                       Damage(hit, self, self, damage * solid_penetration_left, dtype, start, force * dir * solid_penetration_left);
+                       // calculate hits for ballistic weapons
+                       if(g)
+                       {
+                               // do not exceed 100%
+                               float added_damage = min(damage - total_damage, damage * solid_penetration_left);
+                               total_damage += damage * solid_penetration_left;
+                               accuracy_add(self, self.weapon, 0, added_damage);
+                       }
+               }
 
-               self.projectiledeathtype |= HITTYPE_BOUNCE;
-       }
-       frametime = savetime;
-       self = oldself;
+               if (is_weapclip)
+                       break;
 
-       if(lag)
-               FOR_EACH_PLAYER(pl)
-                       if(pl != self)
-                               antilag_restore(pl);
+               // go through solid!
+               // outside the world? forget it
+               if(start_x > world.maxs_x || start_y > world.maxs_y || start_z > world.maxs_z || start_x < world.mins_x || start_y < world.mins_y || start_z < world.mins_z)
+                       break;
 
-       remove(proj);
+               float maxdist;
+               if(max_solid_penetration < 0)
+                       break;
+               else if(hit.ballistics_density < -1)
+                       break; // -2: no solid penetration, ever
+               else if(hit.ballistics_density < 0)
+                       maxdist = vlen(hit.maxs - hit.mins) + 1; // -1: infinite travel distance
+               else if(hit.ballistics_density == 0)
+                       maxdist = max_solid_penetration * solid_penetration_left;
+               else
+                       maxdist = max_solid_penetration * solid_penetration_left * hit.ballistics_density;
 
-       return;
-}
+               if(maxdist <= autocvar_g_ballistics_mindistance)
+                       break;
 
-void fireBullet (vector start, vector dir, float spread, float damage, float force, float dtype, float tracer)
-{
-       vector  end;
+               // move the entity along its velocity until it's out of solid, then let it resume
+               // The previously hit entity is ignored here!
+               traceline_inverted (start, start + dir * maxdist, MOVE_NORMAL, WarpZone_trace_forent, TRUE, hit);
+               if(trace_fraction == 1) // 1: we never got out of solid
+                       break;
 
-       dir = normalize(dir + randomvec() * spread);
-       end = start + dir * MAX_SHOT_DISTANCE;
-       if(self.antilag_debug)
-               traceline_antilag (self, start, end, FALSE, self, self.antilag_debug);
-       else
-               traceline_antilag (self, start, end, FALSE, self, ANTILAG_LATENCY(self));
+               float dist_taken = max(autocvar_g_ballistics_mindistance, vlen(trace_endpos - start));
+               solid_penetration_left *= (dist_taken / maxdist);
 
-       end = trace_endpos;
+               // Only show effect when going through a player (invisible otherwise)
+               if (hit && (hit.solid != SOLID_BSP))
+                       if(vlen(trace_endpos - start) > 4)
+                               trailparticles(self, fireBullet_trace_callback_eff, start, trace_endpos);
 
-       if (pointcontents (trace_endpos) != CONTENT_SKY)
-       {
-               if (!(trace_dphitq3surfaceflags & Q3SURFACEFLAG_NOIMPACT))
-                       Damage_DamageInfo(trace_endpos, damage, 0, 0, dir * max(1, force), dtype, trace_ent.species, self);
+               start = trace_endpos;
 
-               Damage (trace_ent, self, self, damage, dtype, trace_endpos, dir * force);
+               if(hit.solid == SOLID_BSP)
+                       Damage_DamageInfo(start, 0, 0, 0, max(1, force) * normalize(dir) * -solid_penetration_left, dtype, 0, self);
        }
-       trace_endpos = end;
+
+       if(lag)
+               FOR_EACH_PLAYER(pl)
+                       if(pl != self)
+                               antilag_restore(pl);
 }
 
 float W_CheckProjectileDamage(entity inflictor, entity projowner, float deathtype, float exception)
index 90db2ad75c4aa7007409257c5d320a883fb7d888..0e3a5c0b02efed14c2c0eac782edf1a8a532b04a 100644 (file)
@@ -15,7 +15,7 @@ REGISTER_WEAPON(
 
 .float rifle_accumulator;
 
-void W_Rifle_FireBullet(float pSpread, float pDamage, float pForce, float pSpeed, float pLifetime, float pAmmo, float deathtype, float pBulletConstant, float pTracer, float pShots, string pSound)
+void W_Rifle_FireBullet(float pSpread, float pDamage, float pForce, float pSolidPenetration, float pAmmo, float deathtype, float pTracer, float pShots, string pSound)
 {
        float i;
 
@@ -32,8 +32,7 @@ void W_Rifle_FireBullet(float pSpread, float pDamage, float pForce, float pSpeed
        }
 
        for(i = 0; i < pShots; ++i)
-               fireBallisticBullet(w_shotorg, w_shotdir, pSpread, pSpeed, pLifetime, pDamage, pForce, deathtype, (pTracer ? EF_RED : EF_BLUE), pBulletConstant);
-       endFireBallisticBullet();
+               fireBullet(w_shotorg, w_shotdir, pSpread, pSolidPenetration, pDamage, pForce, deathtype, (pTracer ? EF_RED : EF_BLUE));
 
        if (autocvar_g_casings >= 2)
                SpawnCasing (((random () * 50 + 50) * v_right) - (v_forward * (random () * 25 + 25)) - ((random () * 5 - 70) * v_up), 2, vectoangles(v_forward),'0 250 0', 100, 3, self);
@@ -41,12 +40,12 @@ void W_Rifle_FireBullet(float pSpread, float pDamage, float pForce, float pSpeed
 
 void W_Rifle_Attack()
 {
-       W_Rifle_FireBullet(autocvar_g_balance_rifle_primary_spread, autocvar_g_balance_rifle_primary_damage, autocvar_g_balance_rifle_primary_force, autocvar_g_balance_rifle_primary_speed, autocvar_g_balance_rifle_primary_lifetime, autocvar_g_balance_rifle_primary_ammo, WEP_RIFLE, autocvar_g_balance_rifle_primary_bulletconstant, autocvar_g_balance_rifle_primary_tracer, autocvar_g_balance_rifle_primary_shots, "weapons/campingrifle_fire.wav");
+       W_Rifle_FireBullet(autocvar_g_balance_rifle_primary_spread, autocvar_g_balance_rifle_primary_damage, autocvar_g_balance_rifle_primary_force, autocvar_g_balance_rifle_primary_solidpenetration, autocvar_g_balance_rifle_primary_ammo, WEP_RIFLE, autocvar_g_balance_rifle_primary_tracer, autocvar_g_balance_rifle_primary_shots, "weapons/campingrifle_fire.wav");
 }
 
 void W_Rifle_Attack2()
 {
-       W_Rifle_FireBullet(autocvar_g_balance_rifle_secondary_spread, autocvar_g_balance_rifle_secondary_damage, autocvar_g_balance_rifle_secondary_force, autocvar_g_balance_rifle_secondary_speed, autocvar_g_balance_rifle_secondary_lifetime, autocvar_g_balance_rifle_secondary_ammo, WEP_RIFLE | HITTYPE_SECONDARY, autocvar_g_balance_rifle_secondary_bulletconstant, autocvar_g_balance_rifle_secondary_tracer, autocvar_g_balance_rifle_secondary_shots, "weapons/campingrifle_fire2.wav");
+       W_Rifle_FireBullet(autocvar_g_balance_rifle_secondary_spread, autocvar_g_balance_rifle_secondary_damage, autocvar_g_balance_rifle_secondary_force, autocvar_g_balance_rifle_secondary_solidpenetration, autocvar_g_balance_rifle_secondary_ammo, WEP_RIFLE | HITTYPE_SECONDARY, autocvar_g_balance_rifle_secondary_tracer, autocvar_g_balance_rifle_secondary_shots, "weapons/campingrifle_fire2.wav");
 }
 
 void spawnfunc_weapon_rifle (void)
@@ -126,7 +125,7 @@ float w_rifle(float req)
                        self.bot_secondary_riflemooth = 0;
                if(self.bot_secondary_riflemooth == 0)
                {
-                       if(bot_aim(autocvar_g_balance_rifle_primary_speed, 0, autocvar_g_balance_rifle_primary_lifetime, FALSE))
+                       if(bot_aim(1000000, 0, 0.001, FALSE))
                        {
                                self.BUTTON_ATCK = TRUE;
                                if(random() < 0.01) self.bot_secondary_riflemooth = 1;
@@ -134,7 +133,7 @@ float w_rifle(float req)
                }
                else
                {
-                       if(bot_aim(autocvar_g_balance_rifle_secondary_speed, 0, autocvar_g_balance_rifle_secondary_lifetime, FALSE))
+                       if(bot_aim(1000000, 0, 0.001, FALSE))
                        {
                                self.BUTTON_ATCK2 = TRUE;
                                if(random() < 0.03) self.bot_secondary_riflemooth = 0;
index 2fb6214017c0f1de374817fc596b44d9d3f66104..6ac38747526568f66579eefe6580d95ea1555e94 100644 (file)
@@ -21,8 +21,7 @@ void W_Shotgun_Attack (void)
        float   d;
        float   f;
        float   spread;
-       float   bulletspeed;
-       float   bulletconstant;
+       float   solidpenetration;
        entity flash;
 
        ammoamount = autocvar_g_balance_shotgun_primary_ammo;
@@ -30,15 +29,13 @@ void W_Shotgun_Attack (void)
        d = autocvar_g_balance_shotgun_primary_damage;
        f = autocvar_g_balance_shotgun_primary_force;
        spread = autocvar_g_balance_shotgun_primary_spread;
-       bulletspeed = autocvar_g_balance_shotgun_primary_speed;
-       bulletconstant = autocvar_g_balance_shotgun_primary_bulletconstant;
+       solidpenetration = autocvar_g_balance_shotgun_primary_solidpenetration;
 
        W_DecreaseAmmo(ammo_shells, ammoamount, autocvar_g_balance_shotgun_reload_ammo);
 
        W_SetupShot (self, TRUE, 5, "weapons/shotgun_fire.wav", CH_WEAPON_A, d * bullets);
        for (sc = 0;sc < bullets;sc = sc + 1)
-               fireBallisticBullet(w_shotorg, w_shotdir, spread, bulletspeed, 5, d, f, WEP_SHOTGUN, 0, bulletconstant);
-       endFireBallisticBullet();
+               fireBullet(w_shotorg, w_shotdir, spread, solidpenetration, d, f, WEP_SHOTGUN, 0);
 
        pointparticles(particleeffectnum("shotgun_muzzleflash"), w_shotorg, w_shotdir * 1000, autocvar_g_balance_shotgun_primary_ammo);
 
index f70aa044312b803773c89931f4912ae59ef6a8b2..2e081095f12a5b46fe525e63744ef49d3f166d26 100644 (file)
@@ -72,7 +72,7 @@ float W_Tuba_HasPlayed(entity pl, string melody, float instrument, float ignorep
                        mmax = 240 / mintempo; // 60 = "0.25 means 1 sec", at 120 0.5 means 1 sec, at 240 1 means 1 sec
                else
                        mmax = 240; // you won't try THAT hard... (tempo 1)
-               //print(sprintf("initial tempo rules: %f %f\n", mmin, mmax));
+               //printf("initial tempo rules: %f %f\n", mmin, mmax);
 
                for(i = 0; i < n; ++i)
                {
@@ -96,10 +96,10 @@ float W_Tuba_HasPlayed(entity pl, string melody, float instrument, float ignorep
 
                                // vi_x <= vi_y <= vj_x <= vj_y
                                // ti <= tj
-                               //print(sprintf("first note: %f to %f, should be %f\n", vi_x, vi_y, ti));
-                               //print(sprintf("second note: %f to %f, should be %f\n", vj_x, vj_y, tj));
-                               //print(sprintf("m1 = %f\n", (vi_x - vj_y) / (ti - tj)));
-                               //print(sprintf("m2 = %f\n", (vi_y - vj_x) / (ti - tj)));
+                               //printf("first note: %f to %f, should be %f\n", vi_x, vi_y, ti);
+                               //printf("second note: %f to %f, should be %f\n", vj_x, vj_y, tj);
+                               //printf("m1 = %f\n", (vi_x - vj_y) / (ti - tj));
+                               //printf("m2 = %f\n", (vi_y - vj_x) / (ti - tj));
                                mmin = max(mmin, (vi_x - vj_y) / (ti - tj)); // lower bound
                                mmax = min(mmax, (vi_y - vj_x) / (ti - tj)); // upper bound
                        }
index 5fd890a0b7c600124db484093997aefcb62c4bf4..4fb6047430c77e7671cca794854c7182c13f3cbd 100644 (file)
@@ -62,10 +62,9 @@ void W_UZI_Attack (float deathtype)
        ATTACK_FINISHED(self) = time + autocvar_g_balance_uzi_first_refire * W_WeaponRateFactor();
 
        if (self.misc_bulletcounter == 1)
-               fireBallisticBullet(w_shotorg, w_shotdir, autocvar_g_balance_uzi_first_spread, autocvar_g_balance_uzi_speed, 5, autocvar_g_balance_uzi_first_damage, autocvar_g_balance_uzi_first_force, deathtype, 0, autocvar_g_balance_uzi_bulletconstant);
+               fireBullet(w_shotorg, w_shotdir, autocvar_g_balance_uzi_first_spread, autocvar_g_balance_uzi_solidpenetration, autocvar_g_balance_uzi_first_damage, autocvar_g_balance_uzi_first_force, deathtype, 0);
        else
-               fireBallisticBullet(w_shotorg, w_shotdir, autocvar_g_balance_uzi_sustained_spread, autocvar_g_balance_uzi_speed, 5, autocvar_g_balance_uzi_sustained_damage, autocvar_g_balance_uzi_sustained_force, deathtype, 0, autocvar_g_balance_uzi_bulletconstant);
-       endFireBallisticBullet();
+               fireBullet(w_shotorg, w_shotdir, autocvar_g_balance_uzi_sustained_spread, autocvar_g_balance_uzi_solidpenetration, autocvar_g_balance_uzi_sustained_damage, autocvar_g_balance_uzi_sustained_force, deathtype, 0);
 
        pointparticles(particleeffectnum("uzi_muzzleflash"), w_shotorg, w_shotdir * 1000, 1);
 
@@ -136,8 +135,7 @@ void uzi_mode1_fire_auto()
        }
 
        uzi_spread = bound(autocvar_g_balance_uzi_spread_min, autocvar_g_balance_uzi_spread_min + (autocvar_g_balance_uzi_spread_add * self.misc_bulletcounter), autocvar_g_balance_uzi_spread_max);
-       fireBallisticBullet(w_shotorg, w_shotdir, uzi_spread, autocvar_g_balance_uzi_speed, 5, autocvar_g_balance_uzi_sustained_damage, autocvar_g_balance_uzi_sustained_force, WEP_UZI, 0, autocvar_g_balance_uzi_bulletconstant);
-       endFireBallisticBullet();
+       fireBullet(w_shotorg, w_shotdir, uzi_spread, autocvar_g_balance_uzi_solidpenetration, autocvar_g_balance_uzi_sustained_damage, autocvar_g_balance_uzi_sustained_force, WEP_UZI, 0);
 
        self.misc_bulletcounter = self.misc_bulletcounter + 1;
 
@@ -162,9 +160,7 @@ void uzi_mode1_fire_burst()
                self.punchangle_y = random () - 0.5;
        }
 
-       fireBallisticBullet(w_shotorg, w_shotdir, autocvar_g_balance_uzi_burst_spread, autocvar_g_balance_uzi_speed, 5, autocvar_g_balance_uzi_sustained_damage, autocvar_g_balance_uzi_sustained_force, WEP_UZI, 0, autocvar_g_balance_uzi_bulletconstant);
-       endFireBallisticBullet();
-
+       fireBullet(w_shotorg, w_shotdir, autocvar_g_balance_uzi_burst_spread, autocvar_g_balance_uzi_solidpenetration, autocvar_g_balance_uzi_sustained_damage, autocvar_g_balance_uzi_sustained_force, WEP_UZI, 0);
 
        pointparticles(particleeffectnum("uzi_muzzleflash"), w_shotorg, w_shotdir * 1000, 1);
 
index 5370ba519817dc86eff61c527689268af2f09aec..f55cec1d52ea16ac280a04e44f3f1f496d85f9f1 100644 (file)
@@ -13,7 +13,7 @@ void WarpZone_Fade_PreDraw()
                self.alpha = bound(0, (self.warpzone_fadeend - vlen(org - self.origin - 0.5 * (self.mins + self.maxs))) / (self.warpzone_fadeend - self.warpzone_fadestart), 1);
        else
                self.alpha = 1;
-       //print(sprintf("%v <-> %v\n", view_origin, self.origin + 0.5 * (self.mins + self.maxs)));
+       //printf("%v <-> %v\n", view_origin, self.origin + 0.5 * (self.mins + self.maxs));
        if(self.alpha <= 0)
                self.drawmask = 0;
        else
index d91b79b6ceebdd6858051c24c837b21208378732..86864eef19698694e7c571e7e71b845f3e95b65d 100644 (file)
@@ -65,6 +65,11 @@ set g_vehicle_raptor_shield             75
 set g_vehicle_raptor_shield_regen       25
 set g_vehicle_raptor_shield_regen_pause 1.5
 
+set g_vehicle_raptor_blowup_radius           250
+set g_vehicle_raptor_blowup_coredamage       250
+set g_vehicle_raptor_blowup_edgedamage       15
+set g_vehicle_raptor_blowup_forceintensity   250
+
 set g_vehicle_raptor_bouncefactor 0.2
 set g_vehicle_raptor_bouncestop 0
 set g_vehicle_raptor_bouncepain "1 4 1000"
index 88fba2714dbebda0df79d0d27a1150123b6023ff..4258095f7c3b71c633f33f16813c4957262c24b6 100644 (file)
@@ -30,8 +30,7 @@ set g_vehicle_spiderbot_minigun_damage          24       // 400 (x2) DPS
 set g_vehicle_spiderbot_minigun_refire          0.06
 set g_vehicle_spiderbot_minigun_force           9
 set g_vehicle_spiderbot_minigun_spread          0.015
-set g_vehicle_spiderbot_minigun_speed           45000  // ~ 32QU
-set g_vehicle_spiderbot_minigun_bulletconstant  110
+set g_vehicle_spiderbot_minigun_solidpenetration 32
 set g_vehicle_spiderbot_minigun_ammo_cost       1
 set g_vehicle_spiderbot_minigun_ammo_max        100
 set g_vehicle_spiderbot_minigun_ammo_regen      40
@@ -55,6 +54,11 @@ set g_vehicle_spiderbot_rocket_noise      0.2
 set g_vehicle_spiderbot_rocket_lifetime   20
 set g_vehicle_spiderbot_rocket_spread     0.05
 
+set g_vehicle_spiderbot_blowup_radius           250
+set g_vehicle_spiderbot_blowup_coredamage       250
+set g_vehicle_spiderbot_blowup_edgedamage       15
+set g_vehicle_spiderbot_blowup_forceintensity   250
+
 set g_vehicle_spiderbot_bouncefactor 0   // Factor of old velocity to keep after colission
 set g_vehicle_spiderbot_bouncestop 0        // if != 0, New veloctiy after bounce = 0 if new velocity < this
 set g_vehicle_spiderbot_bouncepain "0 0 0" // "minspeed_for_pain speedchange_to_pain_factor max_damage"