chat replacement %s and %S for current speed (XY and XYZ)
authorfruitiex <fruitiex@f962a42d-fe04-0410-a3ab-8c8b0445ebaa>
Sun, 1 Nov 2009 12:03:53 +0000 (12:03 +0000)
committerfruitiex <fruitiex@f962a42d-fe04-0410-a3ab-8c8b0445ebaa>
Sun, 1 Nov 2009 12:03:53 +0000 (12:03 +0000)
git-svn-id: svn://svn.icculus.org/nexuiz/trunk@8197 f962a42d-fe04-0410-a3ab-8c8b0445ebaa

data/qcsrc/server/miscfunctions.qc

index 18b25e6..25e4953 100644 (file)
@@ -491,6 +491,10 @@ string formatmessage(string msg)
             else
                 replacement = "(nobody)";
         }
+       else if (escape == "s")
+               replacement = ftos(vlen(self.velocity - self.velocity_z * '0 0 1'));
+       else if (escape == "S")
+               replacement = ftos(vlen(self.velocity));
         msg = strcat(substring(msg, 0, p), replacement, substring(msg, p+2, strlen(msg) - (p+2)));
         p = p + strlen(replacement);
     }