]> de.git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/blobdiff - qcsrc/csqcmodellib/cl_player.qc
Replace all direct assignments to self with setself(e)
[xonotic/xonotic-data.pk3dir.git] / qcsrc / csqcmodellib / cl_player.qc
index 945a27bff610b5a2aa0e1edf965f91a4203147e8..da10d10ad3d56be0017123444a101aac0f675982 100644 (file)
@@ -220,9 +220,8 @@ void CSQCPlayer_SetCamera()
 
        if(csqcplayer)
        {
-               entity oldself;
-               oldself = self;
-               self = csqcplayer;
+               entity oldself = self;
+               setself(csqcplayer);
 
                if(servercommandframe == 0 || clientcommandframe == 0)
                {
@@ -299,7 +298,7 @@ void CSQCPlayer_SetCamera()
                // relink
                setorigin(self, self.origin);
 
-               self = oldself;
+               setself(oldself);
        }
 
        entity view;
@@ -307,11 +306,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)