]> de.git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/blobdiff - qcsrc/client/miscfunctions.qc
Merge remote-tracking branch 'origin/samual/fix_anim_divisionbyzero'
[xonotic/xonotic-data.pk3dir.git] / qcsrc / client / miscfunctions.qc
index 247dc4b35a64dedc2c7de722420154e9084df48e..d59c75ba8d81629cfc485bea7499a6fe32a9a60a 100644 (file)
@@ -754,3 +754,20 @@ void DrawCircleClippedPic(vector centre, float radius, string pic, float f, vect
                R_EndPolygon();
        }
 }
+
+const vector GETPLAYERORIGIN_ERROR = '1123581321 2357111317 3141592653'; // way out of bounds for anything on the map
+vector getplayerorigin(float pl)
+{
+       string s;
+       entity e;
+
+       s = getplayerkey(pl, "TEMPHACK_origin");
+       if(s != "")
+               return stov(s);
+
+       e = entcs_receiver[pl];
+       if(e)
+               return e.origin;
+
+       return GETPLAYERORIGIN_ERROR;
+}