]> git.rm.cloudns.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
add %o and %O to chat formatting for origin
authordrjaska <drjaska83@gmail.com>
Wed, 10 May 2023 03:06:23 +0000 (06:06 +0300)
committerdrjaska <drjaska83@gmail.com>
Wed, 10 May 2023 03:06:23 +0000 (06:06 +0300)
%O is just for more decimals as an opt-in if %o isn't accurate enough.

qcsrc/server/chat.qc

index 41af1de57c1bae1b23c9bbf42111a3f4fcf29a51..79d8665237b665841b54e0451e844cd1456e94f9 100644 (file)
@@ -505,6 +505,8 @@ string formatmessage(entity this, string msg)
                        case "l": replacement = NearestLocation(this.origin); break;
                        case "y": replacement = NearestLocation(cursor); break;
                        case "d": replacement = NearestLocation(this.death_origin); break;
+                       case "o": replacement = vtos(this.origin); break;
+                       case "O": replacement = sprintf("'%f %f %f'", this.origin.x, this.origin.y, this.origin.z); break;
                        case "w": replacement = WeaponNameFromWeaponentity(this, weaponentity); break;
                        case "W": replacement = GetAmmoName(this.(weaponentity).m_weapon.ammo_type); break;
                        case "x": replacement = ((cursor_ent.netname == "" || !cursor_ent) ? "nothing" : cursor_ent.netname); break;