]> git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/blobdiff - qcsrc/csqcmodellib/cl_player.qc
Merge branch 'master' into TimePath/global_self
[xonotic/xonotic-data.pk3dir.git] / qcsrc / csqcmodellib / cl_player.qc
index 945a27bff610b5a2aa0e1edf965f91a4203147e8..a5afdac8f74ef100205cf94b0ca2ed6a7e13efd8 100644 (file)
@@ -220,9 +220,7 @@ void CSQCPlayer_SetCamera()
 
        if(csqcplayer)
        {
-               entity oldself;
-               oldself = self;
-               self = csqcplayer;
+               setself(csqcplayer);
 
                if(servercommandframe == 0 || clientcommandframe == 0)
                {
@@ -299,7 +297,7 @@ void CSQCPlayer_SetCamera()
                // relink
                setorigin(self, self.origin);
 
-               self = oldself;
+               setself(this);
        }
 
        entity view;
@@ -307,11 +305,9 @@ void CSQCPlayer_SetCamera()
 
        if(view && view != csqcplayer)
        {
-               entity oldself = self;
-               self = view;
-               InterpolateOrigin_Do();
+               SELFCALL(view, InterpolateOrigin_Do());
                self.view_ofs = '0 0 1' * getstati(STAT_VIEWHEIGHT);
-               self = oldself;
+               SELFCALL_DONE();
        }
 
        if(view)