From: Rudolf Polzer Date: Mon, 14 Nov 2011 06:06:05 +0000 (+0100) Subject: remove TEMPHACK_origin X-Git-Tag: xonotic-v0.6.0~74^2~100^2~80 X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=e3579ca78beed2baf7110f5e7c7aaee7203a5252;p=xonotic%2Fxonotic-data.pk3dir.git remove TEMPHACK_origin --- diff --git a/qcsrc/client/miscfunctions.qc b/qcsrc/client/miscfunctions.qc index 1a512c774..26bed80f2 100644 --- a/qcsrc/client/miscfunctions.qc +++ b/qcsrc/client/miscfunctions.qc @@ -575,9 +575,9 @@ vector getplayerorigin(float pl) string s; entity e; - s = getplayerkey(pl, "TEMPHACK_origin"); - if(s != "") - return stov(s); + e = CSQCPlayer_GetPlayer(pl + 1); + if(e) + return e.origin; e = entcs_receiver[pl]; if(e) diff --git a/qcsrc/csqcmodel/cl_player.qc b/qcsrc/csqcmodel/cl_player.qc index f427073e1..9732bd573 100644 --- a/qcsrc/csqcmodel/cl_player.qc +++ b/qcsrc/csqcmodel/cl_player.qc @@ -179,3 +179,8 @@ float CSQCPlayer_PostUpdate() csqcplayer = self; return 1; } + +entity CSQCPlayer_GetPlayer(float pl) +{ + return findfloat(world, entnum, pl); // FIXME optimize this using an array +} diff --git a/qcsrc/csqcmodel/cl_player.qh b/qcsrc/csqcmodel/cl_player.qh index 0eecabed8..f85c4e7cd 100644 --- a/qcsrc/csqcmodel/cl_player.qh +++ b/qcsrc/csqcmodel/cl_player.qh @@ -29,3 +29,4 @@ void CSQCPlayer_SetCamera(); float CSQCPlayer_PreUpdate(); float CSQCPlayer_PostUpdate(); float CSQCPlayer_IsLocalPlayer(); +entity CSQCPlayer_GetPlayer(float pl);