]> git.xonotic.org Git - xonotic/darkplaces.git/commitdiff
make player_localnum and player_localentnum conform to FTEQW
authordivverent <divverent@d7cf8633-e32d-0410-b094-e92efae38249>
Sun, 4 Dec 2011 14:48:14 +0000 (14:48 +0000)
committerdivverent <divverent@d7cf8633-e32d-0410-b094-e92efae38249>
Sun, 4 Dec 2011 14:48:14 +0000 (14:48 +0000)
git-svn-id: svn://svn.icculus.org/twilight/trunk/darkplaces@11595 d7cf8633-e32d-0410-b094-e92efae38249

csprogs.c

index 9046b2bed5cf6fa65372c73b699ae8a26bdc57d5..a99c469b1e84829e98e60da23d73337f6f5cdf60 100644 (file)
--- a/csprogs.c
+++ b/csprogs.c
@@ -249,6 +249,8 @@ static void CSQC_SetGlobals (void)
                VectorCopy(cl.punchvector, PRVM_clientglobalvector(view_punchvector));
                PRVM_clientglobalfloat(maxclients) = cl.maxclients;
 
+               PRVM_clientglobalfloat(player_localentnum) = cl.viewentity;
+
                CSQC_R_RecalcView();
        CSQC_END
 }
@@ -1134,7 +1136,8 @@ void CL_VM_Init (void)
        PRVM_clientglobaledict(self) = 0;
 
        PRVM_clientglobalstring(mapname) = PRVM_SetEngineString(prog, cl.worldname);
-       PRVM_clientglobalfloat(player_localentnum) = cl.playerentity;
+       PRVM_clientglobalfloat(player_localnum) = cl.realplayerentity - 1;
+       PRVM_clientglobalfloat(player_localentnum) = cl.viewentity;
 
        // set map description (use world entity 0)
        PRVM_clientedictstring(prog->edicts, message) = PRVM_SetEngineString(prog, cl.worldmessage);