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;
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;
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;
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;
}
}
- //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)
}
}
- //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.
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;
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;
{
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;
}
}
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))
{
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);
}
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));
}
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);
}
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)
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
}
}
}
- //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
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;
}
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)
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
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)
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)
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); \
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; \
}
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()
}
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);
}
}
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;
}
/*
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);
*/
}
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;
else
{
if (!nocomplain)
- print(sprintf("^1Error:^7 Unknown score field: '%s'\n", str));
+ printf("^1Error:^7 Unknown score field: '%s'\n", str);
continue;
}
:found
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)
{
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]);
}
}
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;
}
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;
}
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;
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)
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;
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"));
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"
NOTIF_CENTER_COUNT,
NOTIF_MULTI_COUNT,
NOTIF_CHOICE_COUNT
- ));
+ );
Destroy_All_Notifications();
CALL_ACCUMULATED_FUNCTION(RegisterNotifications);
#else
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);
// 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"
notiftype,
notifname,
stringtype
- ));
+ );
notif_error = TRUE;
input = substring(input, 1, (strlen(input) - 1));
}
{
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"
notiftype,
notifname,
NOTIF_MAX_ARGS
- ));
+ );
notif_error = TRUE;
break;
}
#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"
notiftype,
notifname,
selected
- ));
+ );
notif_error = TRUE;
break;
}
{
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"
notiftype,
notifname,
NOTIF_MAX_HUDARGS
- ));
+ );
notif_error = TRUE;
break;
}
#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"
notiftype,
notifname,
selected
- ));
+ );
notif_error = TRUE;
break;
}
{
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"
notiftype,
notifname,
NOTIF_MAX_DURCNT
- ));
+ );
notif_error = TRUE;
break;
}
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"
notiftype,
notifname,
selected
- ));
+ );
notif_error = TRUE;
}
break;
}
else
{
- print(sprintf(
+ printf(
strcat(
"^1NOTIFICATION WITH NO SOUND: ",
"^7net_type = %s, net_name = %s.\n"
),
typestring,
namestring
- ));
+ );
notif_error = TRUE;
}
}
}
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"
namestring,
strnum,
flnum
- ));
+ );
notif_error = TRUE;
}
}
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;
}
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;
}
}
// 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;
}
}
// 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
{
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
default:
{
- print(sprintf(
+ printf(
strcat(
"^1NOTIFICATION WITH IMPROPER TYPE: ",
"^7net_type = %d, net_name = %s.\n"
),
typeid,
namestring
- ));
+ );
notif_error = TRUE;
break;
}
default:
{
- print(sprintf(
+ printf(
strcat(
"^1NOTIFICATION WITH IMPROPER TYPE: ",
"^7net_type = %d, net_name = %s.\n"
),
typeid,
namestring
- ));
+ );
notif_error = TRUE;
break;
}
#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)
#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);
}*/
}
void TEST_Fail(string cond)
{
- print(sprintf("Assertion failed: ", cond));
+ printf("Assertion failed: ", cond);
//backtrace();
++TEST_failed;
}
}
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;
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;
}
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;
}
++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;
// 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
// 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;
}
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)
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)
} \
else \
{ \
- print(sprintf( \
+ printf( \
"RegisterSLCategories(): Improper override '%s' for category '%s'!\n", \
s, \
categories[i].cat_name \
- )); \
+ ); \
} \
} \
strunzone(categories[i].override_string); \
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; }
}
}
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;
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();
}
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);
}
}
}
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) == "<")
{
// 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();
}
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)
// 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;
}
/*
if(g_race)
- dprint(sprintf("%f %.6f\n", time, race_GetFractionalLapCount(self)));
+ dprintf("%f %.6f\n", time, race_GetFractionalLapCount(self));
*/
CSQCMODEL_AUTOUPDATE();
// 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)
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
}
{
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)
{
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
}
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)
}
else
{
- dprint(sprintf(
+ dprintf(
"Obituary_WeaponDeath(): ^1Deathtype ^7(%d)^1 has no notification for weapon %d!\n",
deathtype,
death_weapon
- ));
+ );
}
return TRUE;
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));
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)
{
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
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;
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);
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;
/*
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]);
}
*/
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)
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)
{
// 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
}
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