]> de.git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
Merge remote-tracking branch 'origin/master' into samual/weapons
authorSamual Lenks <samual@xonotic.org>
Wed, 1 Jan 2014 13:11:17 +0000 (08:11 -0500)
committerSamual Lenks <samual@xonotic.org>
Wed, 1 Jan 2014 13:11:17 +0000 (08:11 -0500)
Conflicts:
mutator_new_toys.cfg
qcsrc/client/miscfunctions.qc
qcsrc/common/explosion_equation.qc
qcsrc/server/cl_weapons.qc
qcsrc/server/g_damage.qc
qcsrc/server/weapons/weaponsystem.qc

48 files changed:
defaultXonotic.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/player_skeleton.qc
qcsrc/client/scoreboard.qc
qcsrc/client/shownames.qc
qcsrc/client/target_music.qc
qcsrc/client/tturrets.qc
qcsrc/client/waypointsprites.qc
qcsrc/common/command/generic.qc
qcsrc/common/csqcmodel_settings.qh
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/common/weapons/calculations.qc
qcsrc/common/weapons/w_tuba.qc
qcsrc/csqcmodellib/cl_model.qc
qcsrc/csqcmodellib/cl_player.qc
qcsrc/csqcmodellib/common.qh
qcsrc/csqcmodellib/sv_model.qc
qcsrc/menu/item/label.c
qcsrc/menu/menu.qc
qcsrc/menu/xonotic/colorpicker.c
qcsrc/menu/xonotic/serverlist.c
qcsrc/menu/xonotic/slider_decibels.c
qcsrc/menu/xonotic/util.qc
qcsrc/server/cheats.qc
qcsrc/server/cl_client.qc
qcsrc/server/cl_player.qc
qcsrc/server/command/cmd.qc
qcsrc/server/command/vote.qc
qcsrc/server/g_damage.qc
qcsrc/server/g_tetris.qc
qcsrc/server/miscfunctions.qc
qcsrc/server/weapons/accuracy.qc
qcsrc/server/weapons/weaponsystem.qc
qcsrc/warpzonelib/client.qc

index 64bf56256e493511df75e19e09d12db55d82dc61..e040df9734d09dbd11a71a872d15570f68ecfbdb 100644 (file)
@@ -141,6 +141,10 @@ 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_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
 cl_deathfade 0 // fade screen to dark red when dead, value represents how fast the fade is (higher is faster)
index 49d0461a195e689cb982ab49582c93f21bdb6758..7af87c00d84f2139641bf08c4b078e242e32c007 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;
@@ -212,7 +212,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;
@@ -228,7 +228,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;
@@ -423,7 +423,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;
@@ -686,7 +686,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)
@@ -737,7 +737,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.
@@ -752,7 +752,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;
@@ -773,7 +773,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;
@@ -783,7 +783,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;
                }
        }
@@ -866,7 +866,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))
        {
@@ -891,7 +891,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);
 }
@@ -899,7 +899,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));
 }
@@ -908,7 +908,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);
 }
@@ -919,8 +919,10 @@ void Fog_Force()
 {
        // TODO somehow thwart prvm_globalset client ...
 
-       if(forcefog != "")
-               localcmd(strcat(notranslate_fogcmd1, forcefog, notranslate_fogcmd2));
+       if(autocvar_cl_orthoview && autocvar_cl_orthoview_nofog)
+               { localcmd("\nr_drawfog 0\n"); }
+       else if(forcefog != "")
+               { localcmd(strcat(notranslate_fogcmd1, forcefog, notranslate_fogcmd2)); }
 }
 
 void Gamemode_Init();
@@ -1193,7 +1195,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)
index 554ddfaad11cba7822d9fc8c2ceb49c99be79734..837c72f3e5ff3ae3f94158726012badfa28e8804 100644 (file)
@@ -199,6 +199,17 @@ vector GetCurrentFov(float fov)
        return '1 0 0' * fovx + '0 1 0' * fovy;
 }
 
+vector GetOrthoviewFOV(vector ov_worldmin, vector ov_worldmax, vector ov_mid, vector ov_org)
+{
+       float fovx, fovy;
+       float width = (ov_worldmax_x - ov_worldmin_x);
+       float height = (ov_worldmax_y - ov_worldmin_y);
+       float distance_to_middle_of_world = vlen(ov_mid - ov_org);
+       fovx = atan2(width/2, distance_to_middle_of_world) / M_PI * 360.0;
+       fovy = atan2(height/2, distance_to_middle_of_world) / M_PI * 360.0;
+       return '1 0 0' * fovx + '0 1 0' * fovy;
+}
+
 // this function must match W_SetupShot!
 float zoomscript_caught;
 
@@ -307,13 +318,15 @@ float TrueAimCheck()
                        break;
        }
 
+       vector traceorigin = getplayerorigin(player_localentnum-1) + (eZ * getstati(STAT_VIEWHEIGHT));
+
        vecs = decompressShotOrigin(getstati(STAT_SHOTORG));
 
-       traceline(view_origin, view_origin + view_forward * MAX_SHOT_DISTANCE, mv, ta);
+       traceline(traceorigin, traceorigin + view_forward * MAX_SHOT_DISTANCE, mv, ta);
        trueaimpoint = trace_endpos;
 
-       if(vlen(trueaimpoint - view_origin) < g_trueaim_minrange)
-               trueaimpoint = view_origin + view_forward * g_trueaim_minrange;
+       if(vlen(trueaimpoint - traceorigin) < g_trueaim_minrange)
+               trueaimpoint = traceorigin + view_forward * g_trueaim_minrange;
 
        if(vecs_x > 0)
                vecs_y = -vecs_y;
@@ -321,7 +334,7 @@ float TrueAimCheck()
                vecs = '0 0 0';
 
        dv = view_right * vecs_y + view_up * vecs_z;
-       w_shotorg = view_origin + dv;
+       w_shotorg = traceorigin + dv;
 
        // now move the vecs forward as much as requested if possible
        tracebox(w_shotorg, mi, ma, w_shotorg + view_forward * (vecs_x + nudge), MOVE_NORMAL, ta); // FIXME this MOVE_NORMAL part will misbehave a little in csqc
@@ -480,7 +493,7 @@ void CSQC_UpdateView(float w, float h)
        // event chase camera
        if(autocvar_chase_active <= 0) // greater than 0 means it's enabled manually, and this code is skipped
        {
-               if((spectatee_status >= 0 && (autocvar_cl_eventchase_death && is_dead)) || intermission)
+               if(((spectatee_status >= 0 && (autocvar_cl_eventchase_death && is_dead)) || intermission) && !autocvar_cl_orthoview)
                {
                        // make special vector since we can't use view_origin (It is one frame old as of this code, it gets set later with the results this code makes.)
                        vector current_view_origin = (csqcplayer ? csqcplayer.origin : pmove_org);
@@ -549,6 +562,60 @@ void CSQC_UpdateView(float w, float h)
        WarpZone_FixView();
        //WarpZone_FixPMove();
 
+       vector ov_org = '0 0 0';
+       vector ov_mid = '0 0 0';
+       vector ov_worldmin = '0 0 0';
+       vector ov_worldmax = '0 0 0';
+       if(autocvar_cl_orthoview)
+       {
+               ov_worldmin = mi_picmin;
+               ov_worldmax = mi_picmax;
+
+               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));
+
+               ov_mid = ((ov_worldmax + ov_worldmin) * 0.5);
+               ov_org = vec3(ov_mid_x, ov_mid_y, (ov_mid_z + ov_distance));
+
+               float ov_nearest = vlen(ov_org - vec3(
+                       bound(ov_worldmin_x, ov_org_x, ov_worldmax_x),
+                       bound(ov_worldmin_y, ov_org_y, ov_worldmax_y),
+                       bound(ov_worldmin_z, ov_org_z, ov_worldmax_z)
+               ));
+
+               float ov_furthest = 0;
+               float dist = 0;
+
+               if((dist = vlen(vec3(ov_worldmin_x, ov_worldmin_y, ov_worldmin_z) - ov_org)) > ov_furthest) { ov_furthest = dist; }
+               if((dist = vlen(vec3(ov_worldmax_x, ov_worldmin_y, ov_worldmin_z) - ov_org)) > ov_furthest) { ov_furthest = dist; }
+               if((dist = vlen(vec3(ov_worldmin_x, ov_worldmax_y, ov_worldmin_z) - ov_org)) > ov_furthest) { ov_furthest = dist; }
+               if((dist = vlen(vec3(ov_worldmin_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_worldmin_z) - ov_org)) > ov_furthest) { ov_furthest = dist; }
+               if((dist = vlen(vec3(ov_worldmin_x, ov_worldmax_y, ov_worldmax_z) - ov_org)) > ov_furthest) { ov_furthest = dist; }
+               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");
+
+               setproperty(VF_ORIGIN, ov_org);
+               setproperty(VF_ANGLES, '90 0 0');
+
+               #if 0
+               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);
+               #endif
+       }
+
        // Render the Scene
        view_origin = getpropertyvec(VF_ORIGIN);
        view_angles = getpropertyvec(VF_ANGLES);
@@ -690,7 +757,8 @@ void CSQC_UpdateView(float w, float h)
        vid_conheight = autocvar_vid_conheight;
        vid_pixelheight = autocvar_vid_pixelheight;
 
-       setproperty(VF_FOV, GetCurrentFov(fov));
+       if(autocvar_cl_orthoview) { setproperty(VF_FOV, GetOrthoviewFOV(ov_worldmin, ov_worldmax, ov_mid, ov_org)); }
+       else { setproperty(VF_FOV, GetCurrentFov(fov)); }
 
        // Camera for demo playback
        if(camera_active)
@@ -1185,7 +1253,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 bd3870762d867a4bc565521823e689c0b07130d2..304796b8be5fc8a377d968d2e9f1ce5a9e26e5f1 100644 (file)
@@ -54,6 +54,9 @@ float autocvar_cl_gunalign;
 float autocvar_cl_hidewaypoints;
 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 848c632773404b03f3e2b2f5cdea611483e78a17..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)
@@ -610,7 +610,22 @@ void CSQCModel_Hook_PreDraw(float isplayer)
                CSQCPlayer_ModelAppearance_Apply(self.entnum == player_localnum + 1);
                CSQCPlayer_LOD_Apply();
                if(!isplayer)
+               {
+                       skeleton_loadinfo(self);
+                       float doblend = (self.bone_upperbody >= 0);
                        CSQCPlayer_FallbackFrame_Apply();
+                       if(doblend)
+                       {
+                               skeleton_from_frames(self, self.csqcmodel_isdead);
+                       }
+                       else
+                       {
+                               free_skeleton_from_frames(self);
+                               // just in case, clear these (we're animating in frame and frame3)
+                               self.lerpfrac = 0;
+                               self.lerpfrac4 = 0;
+                       }
+               }
                else
                {
                        // we know that frame3 and frame4 fields, used by InterpolateAnimation, are left alone - but that is all we know!
index d3f24bd831347f0b52f1dac16947dfa3ef97d3ce..93f1b548cd6acebd8a0341546a62a8274c4fcf20 100644 (file)
@@ -4041,7 +4041,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)
@@ -4207,8 +4207,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)
@@ -4231,16 +4230,20 @@ void HUD_CenterPrint (void)
                                continue;
                }
 
+               all_messages_expired = FALSE;
 
                // fade the centerprint_hud in/out
-               if(centerprint_time[j] < 0)
-                       a = bound(0, (time - centerprint_expire_time[j]) / max(0.0001, autocvar_hud_panel_centerprint_fade_in), 1);
-               else if(centerprint_expire_time[j] - autocvar_hud_panel_centerprint_fade_out > time)
-                       a = bound(0, (time - (centerprint_expire_time[j] - centerprint_time[j])) / max(0.0001, autocvar_hud_panel_centerprint_fade_in), 1);
-               else if(centerprint_expire_time[j] > time)
+               if(centerprint_time[j] < 0)  // Expired but forced. Expire time is the fade-in time.
+                       a = (time - centerprint_expire_time[j]) / max(0.0001, autocvar_hud_panel_centerprint_fade_in);
+               else if(centerprint_expire_time[j] - autocvar_hud_panel_centerprint_fade_out > time)  // Regularily printed. Not fading out yet.
+                       a = (time - (centerprint_expire_time[j] - centerprint_time[j])) / max(0.0001, autocvar_hud_panel_centerprint_fade_in);
+               else // Expiring soon, so fade it out.
                        a = (centerprint_expire_time[j] - time) / max(0.0001, autocvar_hud_panel_centerprint_fade_out);
-               else
-                       a = 0;
+
+               if (a <= 0.5/255.0)  // Guaranteed invisible - don't show.
+                       continue;
+               if (a > 1)
+                       a = 1;
 
                // set the size from fading in/out before subsequent fading
                sz = autocvar_hud_panel_centerprint_fade_minfontsize + a * (1 - autocvar_hud_panel_centerprint_fade_minfontsize);
@@ -4251,6 +4254,7 @@ void HUD_CenterPrint (void)
                        a = a * bound(autocvar_hud_panel_centerprint_fade_subsequent_passone_minalpha, (1 - (g / max(1, autocvar_hud_panel_centerprint_fade_subsequent_passone))), 1); // pass one: all messages after the first have half theAlpha
                        a = a * bound(autocvar_hud_panel_centerprint_fade_subsequent_passtwo_minalpha, (1 - (g / max(1, autocvar_hud_panel_centerprint_fade_subsequent_passtwo))), 1); // pass two: after that, gradually lower theAlpha even more for each message
                }
+               a *= panel_fg_alpha;
 
                // finally set the size based on the new theAlpha from subsequent fading
                sz = sz * (autocvar_hud_panel_centerprint_fade_subsequent_minfontsize + a * (1 - autocvar_hud_panel_centerprint_fade_subsequent_minfontsize));
@@ -4290,7 +4294,8 @@ void HUD_CenterPrint (void)
                                {
                                        if (align)
                                                pos_x = panel_pos_x + (panel_size_x - stringwidth(ts, TRUE, fontsize)) * align;
-                                       drawcolorcodedstring(pos + eY * 0.5 * (1 - sz) * fontsize_y, ts, fontsize, a * panel_fg_alpha, DRAWFLAG_NORMAL);
+                                       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;
                                }
                                else
@@ -4327,7 +4332,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 569073694db352e60653334104b6ba971e3dee4a..9b42da8aa8586ae14d58731259d3969522ad3127 100644 (file)
@@ -587,6 +587,17 @@ vector getcsqcplayercolor(float pl)
        return '1 1 1';
 }
 
+float getplayeralpha(float pl)
+{
+       entity e;
+
+       e = CSQCModel_server2csqc(pl + 1);
+       if(e)
+               return e.alpha;
+
+       return 1;
+}
+
 float getplayerisdead(float pl)
 {
        entity e;
@@ -615,7 +626,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 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 d7f69c7d969468d6537eef1dd7dc01ddf985b5b6..dfae870cc385d6d86764ac8a1b8b05b6848ddfb8 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 c581fba428fe42ff44f203da50c94f7f612e8eb1..413eaaf54714170958e354c59a6d5cf39c1bdffb 100644 (file)
@@ -100,7 +100,11 @@ void Draw_ShowNames(entity ent)
                else if(time > ent.fadedelay) // fade in for enemies
                        ent.alpha = min(1, ent.alpha + SHOWNAMES_FADESPEED * frametime);
 
-               if(!ent.alpha)
+               // multiply by player alpha
+               if(!ent.sameteam || (ent.sv_entnum == player_localentnum))
+                       ent.alpha *= getplayeralpha(ent.sv_entnum-1);
+
+               if(ent.alpha < ALPHA_MIN_VISIBLE)
                        return;
 
                float dist;
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 1c53eb7fe4750b9b329319fe44bf01d07350cc8b..c174d7656af19b8209faedbc05d5162d10b6751f 100644 (file)
@@ -431,7 +431,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 1c32c86befbeefdfd74f35f48608a396fdeb1234..3f87609ee1c7161782f4d4269a62fe328d79f4e1 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"));
@@ -486,7 +486,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"
@@ -503,7 +503,7 @@ void GenericCommand_restartnotifs(float request)
                                NOTIF_CENTER_COUNT,
                                NOTIF_MULTI_COUNT,
                                NOTIF_CHOICE_COUNT
-                       ));
+                       );
                        Destroy_All_Notifications();
                        CALL_ACCUMULATED_FUNCTION(RegisterNotifications);
                        #else
index 9f202d2b384ab3ca421df06cae81579319edbf90..cfe012275cdeb6105f4009c6e76d79baf46beae4 100644 (file)
@@ -47,8 +47,8 @@
                CSQCMODEL_ENDIF \
                CSQCMODEL_PROPERTY(512, float, ReadChar, WriteChar, anim_upper_action) \
                CSQCMODEL_PROPERTY(512, float, ReadApproxPastTime, WriteApproxPastTime, anim_upper_time) \
-               CSQCMODEL_PROPERTY(1024, float, ReadAngle, WriteAngle, v_angle_x) \
        CSQCMODEL_ENDIF \
+       CSQCMODEL_PROPERTY(1024, float, ReadAngle, WriteAngle, v_angle_x) \
        CSQCMODEL_PROPERTY_SCALED(4096, float, ReadByte, WriteByte, scale, 16, 0, 255)
 // TODO get rid of colormod/glowmod here, find good solution for nex charge glowmod hack; also get rid of some useless properties on non-players that only exist for CopyBody
 
index 8c297513e72e4f97ac85a42ffa24a5043498ea93..3605d0b6f1eede3da4a001aef33ea9846ffd4ebb 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;
                }
index 617bc88cbed1ceed52f6a5697f4a950c0b075006..7beb03d84f5aaf87a70fdff012c0fb7ef3e6acd8 100644 (file)
@@ -1469,7 +1469,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)
@@ -1481,8 +1481,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 f2f6505679ca8c11167f451730b0a85a3c1945b5..cc96da11e3e9dd49ae1487157ac0b7f118fc2e2d 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;
@@ -1312,7 +1312,7 @@ string find_last_color_code(string s)
                        ++carets;
 
                // check if carets aren't all escaped
-               if (carets == 1 || mod(carets, 2) == 1) // first check is just an optimization
+               if (carets & 1)
                {
                        if(i+1 <= len)
                        if(strstrofs("0123456789", substring(s, i+1, 1), 0) >= 0)
index 3fb3ab63671d3b066e00e0d9ebe9030e431ebc16..587f57e8b12b39581fa1c856d273e53e8d8c6982 100644 (file)
@@ -371,6 +371,12 @@ vector get_corner_position(entity box, float corner);
 // 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 183a5e5ed0f829e6867b23046c8514d52f046c6c..7bc64e0b5371c0ddf3fb007257f5f6af34c25480 100644 (file)
@@ -55,11 +55,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 8adbcd024658631fb8d58d5169c736f9ff29b826..9c8ea1a20222a0df972c31745f83dc0f3fa18ebb 100644 (file)
@@ -92,7 +92,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)
                {
@@ -116,10 +116,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 30292852200dd75b39641b964d7b672389e97123..e04b92ecc8d81f1a587a9959e3e135d97303ba67 100644 (file)
@@ -203,7 +203,7 @@ void CSQCModel_Draw()
 void CSQCModel_Read(float isnew)
 {
        float sf;
-       sf = ReadShort();
+       sf = ReadInt24_t();
 
        // some nice flags for CSQCMODEL_IF and the hooks
        local noref float isplayer = (self.entnum >= 1 && self.entnum <= maxclients);
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 4cf60174de7c2183daafea9acbc01ea03a162f19..2c13404f5f6f6a4490d26c3a40a9c3011d5cb7e5 100644 (file)
@@ -50,15 +50,15 @@ IN THE SOFTWARE.\
 .float frame2time;
 .float lerpfrac;
 
-#define CSQCMODEL_PROPERTY_FRAME 32768
-#define CSQCMODEL_PROPERTY_TELEPORTED 16384 // the "teleport bit" cancelling interpolation
-#define CSQCMODEL_PROPERTY_MODELINDEX 8192
-#define CSQCMODEL_PROPERTY_ORIGIN 4096
-#define CSQCMODEL_PROPERTY_YAW 2048
-#define CSQCMODEL_PROPERTY_PITCHROLL 1024
-#define CSQCMODEL_PROPERTY_FRAME2 512
-#define CSQCMODEL_PROPERTY_LERPFRAC 256
-#define CSQCMODEL_PROPERTY_SIZE 128
+#define CSQCMODEL_PROPERTY_FRAME 8388608
+#define CSQCMODEL_PROPERTY_TELEPORTED 4194304 // the "teleport bit" cancelling interpolation
+#define CSQCMODEL_PROPERTY_MODELINDEX 2097152
+#define CSQCMODEL_PROPERTY_ORIGIN 1048576
+#define CSQCMODEL_PROPERTY_YAW 524288
+#define CSQCMODEL_PROPERTY_PITCHROLL 262144
+#define CSQCMODEL_PROPERTY_FRAME2 131072
+#define CSQCMODEL_PROPERTY_LERPFRAC 65536
+#define CSQCMODEL_PROPERTY_SIZE 32768
 
 #define ALLPROPERTIES_COMMON \
        CSQCMODEL_PROPERTY(CSQCMODEL_PROPERTY_FRAME, float, ReadByte, WriteByte, frame) \
index e0098b4876ea202ec2fdb12f50f9b0977084b50c..ef47a54da35370694038574a498a851092142d86 100644 (file)
@@ -34,7 +34,7 @@ float CSQCModel_Send(entity to, float sf)
        unused_float = isnolocalplayer;
 
        WriteByte(MSG_ENTITY, ENT_CLIENT_MODEL);
-       WriteShort(MSG_ENTITY, sf);
+       WriteInt24_t(MSG_ENTITY, sf);
 
 #define CSQCMODEL_IF(cond) if(cond) {
 #define CSQCMODEL_ENDIF }
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 eca6df5f358f44c9210f7c1cb20eb88bfcb3d8c5..e0727373c14b3a4795db1cde2f3caadaec45bfbc 100644 (file)
@@ -72,39 +72,60 @@ vector color_hslimage(vector v, vector margin)
 
 float XonoticColorpicker_mouseDrag(entity me, vector coords)
 {
-       float i;
+       float i, carets;
        for(;;)
        {
                i = me.controlledTextbox.cursorPos;
                if(i >= 2)
                {
                        if(substring(me.controlledTextbox.text, i-2, 1) == "^")
-                               if(strstrofs("0123456789", substring(me.controlledTextbox.text, i-1, 1), 0) >= 0)
-                               {
-                                       me.controlledTextbox.keyDown(me.controlledTextbox, K_BACKSPACE, 8, 0);
-                                       me.controlledTextbox.keyDown(me.controlledTextbox, K_BACKSPACE, 8, 0);
-                                       continue;
-                               }
+                       {
+                               carets = 1;
+                               while (i - 2 - carets >= 0 && substring(me.controlledTextbox.text, i - 2 - carets, 1) == "^")
+                                       ++carets;
+                               if (carets & 1)
+                                       if(strstrofs("0123456789", substring(me.controlledTextbox.text, i-1, 1), 0) >= 0)
+                                       {
+                                               me.controlledTextbox.keyDown(me.controlledTextbox, K_BACKSPACE, 8, 0);
+                                               me.controlledTextbox.keyDown(me.controlledTextbox, K_BACKSPACE, 8, 0);
+                                               continue;
+                                       }
+                       }
                }
 
                if(i >= 5)
                {
                        if(substring(me.controlledTextbox.text, i-5, 2) == "^x")
-                               if(strstrofs("0123456789abcdefABCDEF", substring(me.controlledTextbox.text, i-3, 1), 0) >= 0)
-                                       if(strstrofs("0123456789abcdefABCDEF", substring(me.controlledTextbox.text, i-2, 1), 0) >= 0)
-                                               if(strstrofs("0123456789abcdefABCDEF", substring(me.controlledTextbox.text, i-1, 1), 0) >= 0)
-                                               {
-                                                       me.controlledTextbox.keyDown(me.controlledTextbox, K_BACKSPACE, 8, 0);
-                                                       me.controlledTextbox.keyDown(me.controlledTextbox, K_BACKSPACE, 8, 0);
-                                                       me.controlledTextbox.keyDown(me.controlledTextbox, K_BACKSPACE, 8, 0);
-                                                       me.controlledTextbox.keyDown(me.controlledTextbox, K_BACKSPACE, 8, 0);
-                                                       me.controlledTextbox.keyDown(me.controlledTextbox, K_BACKSPACE, 8, 0);
-                                                       continue;
-                                               }
+                       {
+                               carets = 1;
+                               while (i - 5 - carets >= 0 && substring(me.controlledTextbox.text, i - 5 - carets, 1) == "^")
+                                       ++carets;
+                               if (carets & 1)
+                                       if(strstrofs("0123456789abcdefABCDEF", substring(me.controlledTextbox.text, i-3, 1), 0) >= 0)
+                                               if(strstrofs("0123456789abcdefABCDEF", substring(me.controlledTextbox.text, i-2, 1), 0) >= 0)
+                                                       if(strstrofs("0123456789abcdefABCDEF", substring(me.controlledTextbox.text, i-1, 1), 0) >= 0)
+                                                       {
+                                                               me.controlledTextbox.keyDown(me.controlledTextbox, K_BACKSPACE, 8, 0);
+                                                               me.controlledTextbox.keyDown(me.controlledTextbox, K_BACKSPACE, 8, 0);
+                                                               me.controlledTextbox.keyDown(me.controlledTextbox, K_BACKSPACE, 8, 0);
+                                                               me.controlledTextbox.keyDown(me.controlledTextbox, K_BACKSPACE, 8, 0);
+                                                               me.controlledTextbox.keyDown(me.controlledTextbox, K_BACKSPACE, 8, 0);
+                                                               continue;
+                                                       }
+                       }
                }
                break;
        }
 
+       if(substring(me.controlledTextbox.text, i-1, 1) == "^")
+       {
+               carets = 1;
+               while (i - 1 - carets >= 0 && substring(me.controlledTextbox.text, i - 1 - carets, 1) == "^")
+                       ++carets;
+               if (carets & 1)
+                       me.controlledTextbox.enterText(me.controlledTextbox, "^"); // escape previous caret
+       }
+
        vector margin;
        margin = me.imagemargin;
        if(coords_x >= margin_x)
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 34f67397eb0bef09944f2cc1627facd0cfb668c9..d98368074a717cfc5b5d627fae9d7372aaecf7b6 100644 (file)
@@ -87,7 +87,12 @@ void saveCvarsMulti(entity me)
 
        n = tokenize_console(me.cvarNames_Multi);
        for(i = 0; i < n; ++i)
-               cvar_set(argv(i), s);
+       {
+               if(substring(argv(i), 0, 1) == "!")
+                       cvar_set(substring(argv(i), 1, strlen(argv(i))), ((s == "0") ? "1" : "0"));
+               else
+                       cvar_set(argv(i), s);
+       }
 }
 void makeMulti(entity e, string otherCvars)
 {
@@ -280,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);
        }
 }
 
@@ -300,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) == "<")
@@ -389,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 189eeea839caff1e3adebd31f75b7e1f5c02aee8..4ffa3c803ae7cb1ac7703faf400527cb0693795b 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 693b54e3e25f32276f43c9947f6de4807b77f96d..7b6f3dbce941e44c8d00c9aec6cafa076b2294cb 100644 (file)
@@ -2607,7 +2607,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 c95a96fb2450a7f80c3cc9966d2222f7471b63c0..6548912ab26d65920e4b58673d0333fdac5c0999 100644 (file)
@@ -32,6 +32,7 @@ void CopyBody(float keepvelocity)
        self.teleportable = oldself.teleportable;
        self.damagedbycontents = oldself.damagedbycontents;
        self.angles = oldself.angles;
+       self.v_angle = oldself.v_angle;
        self.avelocity = oldself.avelocity;
        self.classname = "body";
        self.damageforcescale = oldself.damageforcescale;
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 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 b9d2ab9aae78052befe77b1cbfd31e56d78e37e1..96e4d0af1a201fdd2f0e1ef0c0b298e9cf2e6200 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;
@@ -923,12 +923,14 @@ float RadiusDamageForSource (entity inflictor, vector inflictororigin, vector in
                                                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));
@@ -936,7 +938,7 @@ float RadiusDamageForSource (entity inflictor, vector inflictororigin, vector in
                                                        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)
                                                {
@@ -963,7 +965,7 @@ float RadiusDamageForSource (entity inflictor, vector inflictororigin, vector in
                                                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));
                                        }
 
                                        //if (targ == attacker)
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 2cc6ee51b8a6ad1436cd8513c1d5337478f40262..385e14e7c25d722bf1116f2d305adbf51b3054f8 100644 (file)
@@ -1707,7 +1707,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)
index 00605ce6b966850b90cc5a8b870f2ab99af45524..5b22669ce1c0bf04b49930f67a7e42cdc1ad57ae 100644 (file)
@@ -1,6 +1,6 @@
 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 da98d7f1cad869718334d004e52299ba4780d5dd..9ac6202fdce2991ca60ed2d2cbf3848c7d9ced61 100644 (file)
@@ -322,14 +322,12 @@ void CL_Weaponentity_Think()
        {
                entity newwep = get_weaponinfo(self.owner.switchweapon);
                f = f * g_weaponratefactor / max(f, newwep.switchdelay_raise);
-               //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)));
                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, oldwep.switchdelay_drop);
-               //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)));
                self.angles_x = -90 * f * f;
        }
        else if (self.state == WS_CLEAR)
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