]> git.rm.cloudns.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
Add replacements for %T and %t (time)
authorMario <zacjardine@y7mail.com>
Thu, 1 Oct 2015 02:48:14 +0000 (12:48 +1000)
committerMario <zacjardine@y7mail.com>
Thu, 1 Oct 2015 02:48:14 +0000 (12:48 +1000)
qcsrc/server/miscfunctions.qc

index 0a4108a8e94d5783e6622fd829577319be58f4a9..5317fe6841b5ee8fec6fde781d9d12c090010c2f 100644 (file)
@@ -299,6 +299,8 @@ string formatmessage(string msg)
                        case "x": replacement = ((cursor_ent.netname == "" || !cursor_ent) ? "nothing" : cursor_ent.netname); break;
                        case "s": replacement = ftos(vlen(self.velocity - self.velocity_z * '0 0 1')); break;
                        case "S": replacement = ftos(vlen(self.velocity)); break;
+                       case "t": replacement = seconds_tostring(ceil(max(0, autocvar_timelimit * 60 + game_starttime - time))); break;
+                       case "T": replacement = seconds_tostring(time); break;
                        default:
                        {
                                MUTATOR_CALLHOOK(FormatMessage, escape, replacement, msg);