]> de.git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/blobdiff - qcsrc/common/viewloc.qc
Merge branch 'master' into martin-t/globals
[xonotic/xonotic-data.pk3dir.git] / qcsrc / common / viewloc.qc
index e4e5ba991bec4fafa3dfc4bfbe278d69f4e2214c..55e37c4d9271d0c2699aeff577d8262aedf4e21f 100644 (file)
@@ -48,7 +48,7 @@ void viewloc_PlayerPhysics(entity this)
                        if(PHYS_CS(this).movement_x > 0) // right
                                this.angles_y = forward.y;
                }
-
+       #if 0
                //if(!PHYS_INPUT_BUTTON_CROUCH(this) && !IS_DUCKED(this))
                if(!(this.viewloc.spawnflags & VIEWLOC_FREEMOVE))
                {
@@ -65,6 +65,7 @@ void viewloc_PlayerPhysics(entity this)
                        //else { input_buttons &= ~16; this.flags &= ~FL_DUCKED; }
 #endif
                }
+       #endif
        }
 }
 
@@ -76,10 +77,12 @@ void viewloc_SetTags(entity this)
                this.viewloc = NULL;
 
        if(this.viewloc.entnum != this.tag_networkviewloc)
-       if(this.tag_networkviewloc == 0)
-               this.viewloc = NULL;
-       else
-               this.viewloc = findfloat(NULL, entnum, this.tag_networkviewloc);
+       {
+               if(this.tag_networkviewloc == 0)
+                       this.viewloc = NULL;
+               else
+                       this.viewloc = findfloat(NULL, entnum, this.tag_networkviewloc);
+       }
 }
 
 vector CursorToWorldCoord(vector mpos)
@@ -199,4 +202,10 @@ void viewloc_SetViewLocation()
        }
 }
 
+STATIC_INIT_LATE(viewloc_cursor)
+{
+       // fix the mouse position on init so it isn't in the corner
+       viewloc_mousepos = '0.5 0 0' * autocvar_vid_conwidth + '0 0.5 0' * autocvar_vid_conheight;
+}
+
 #endif