From: Rudolf Polzer Date: Sun, 11 Dec 2011 12:46:38 +0000 (+0100) Subject: sprintf1s in help X-Git-Tag: xonotic-v0.6.0~35^2~1 X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=fdc6550fe8559e3a4ce5bc5769b1d3d0747207c9;p=xonotic%2Fxonotic-data.pk3dir.git sprintf1s in help --- diff --git a/qcsrc/common/gamecommand.qc b/qcsrc/common/gamecommand.qc index ee1657d66..9595ed5c2 100644 --- a/qcsrc/common/gamecommand.qc +++ b/qcsrc/common/gamecommand.qc @@ -193,6 +193,7 @@ float GameCommand_Generic(string command) print(" time ------------------------------> f : seconds since VM start\n"); print(" s /MD4 digest ---------------------> s : MD4 digest\n"); print(" s /SHA256 digest ------------------> s : SHA256 digest\n"); + print(" s /formatstring sprintf1s ---------> s : sprintf with 1 string (pad, cut)\n"); print(" Set operations operate on 'such''strings'.\n"); print(" Unknown tokens insert their cvar value.\n"); print(" maplist add map\n"); @@ -791,6 +792,9 @@ float GameCommand_Generic(string command) } else if(rpncmd == "digest") { s = rpn_pop(); rpn_set(digest_hex(s, rpn_get())); + } else if(rpncmd == "sprintf1s") { + s = rpn_pop(); + rpn_set(sprintf(s, rpn_get())); } else { rpn_push(cvar_string(rpncmd)); }