]> de.git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
Add constants for player hitbox, for use in a couple of places where varying size...
authorMario <zacjardine@y7mail.com>
Tue, 5 May 2015 11:04:44 +0000 (21:04 +1000)
committerMario <zacjardine@y7mail.com>
Tue, 5 May 2015 11:04:44 +0000 (21:04 +1000)
qcsrc/client/main.qc
qcsrc/common/constants.qh
qcsrc/server/mutators/gamemode_ctf.qh
qcsrc/server/spawnpoints.qc

index a3527366d55613d80132318136b171549e525b89..121438e29fb6b550ce200c0f3d720b1d404baed2 100644 (file)
@@ -667,7 +667,7 @@ void Ent_ReadSpawnPoint(float is_new) // entity for spawnpoint
        if(is_new)
        {
                self.origin = spn_origin;
-               setsize(self, '-16 -16 -24', '16 16 45');
+               setsize(self, PL_MIN_CONST, PL_MAX_CONST);
                droptofloor();
 
                /*if(autocvar_cl_spawn_point_model) // needs a model first
index d7e89fac292104eb03669050f69b2d0723af4b80..680746c6314d4918177eadd052923d20d7c62abe 100644 (file)
@@ -312,7 +312,7 @@ const int SERVERFLAG_ALLOW_FULLBRIGHT = 1;
 const int SERVERFLAG_TEAMPLAY = 2;
 const int SERVERFLAG_PLAYERSTATS = 4;
 
-// FIXME/EXPLAINME: why?
+// FIXME/EXPLAINME: why? Mario: because
 vector autocvar_sv_player_maxs = '16 16 45';
 vector autocvar_sv_player_mins = '-16 -16 -24';
 vector autocvar_sv_player_viewoffset = '0 0 20';
@@ -322,6 +322,7 @@ vector autocvar_sv_player_crouch_viewoffset = '0 0 20';
 vector autocvar_sv_player_headsize = '24 24 12';
 
 
+// not so constant
 #ifdef SVQC
 #define PL_VIEW_OFS autocvar_sv_player_viewoffset
 #define PL_MIN autocvar_sv_player_mins
@@ -339,6 +340,10 @@ vector autocvar_sv_player_headsize = '24 24 12';
 #define PL_CROUCH_MAX vec3(getstatf(STAT_PL_CROUCH_MAX1), getstatf(STAT_PL_CROUCH_MAX2), getstatf(STAT_PL_CROUCH_MAX3))
 #endif
 
+// a bit more constant
+const vector PL_MAX_CONST = '16 16 45';
+const vector PL_MIN_CONST = '-16 -16 -24';
+
 // spawnpoint prios
 const int SPAWN_PRIO_NEAR_TEAMMATE_FOUND = 200;
 const int SPAWN_PRIO_NEAR_TEAMMATE_SAMETEAM = 100;
index a22846c40b79994b5a74d3a1235cd543bd5af174..faf12a4fe7682669335cf9a3859cd4abf9a514c5 100644 (file)
@@ -16,8 +16,8 @@ const int SP_CTF_FCKILLS = 8;
 const int SP_CTF_RETURNS = 9;
 
 // flag constants // for most of these, there is just one question to be asked: WHYYYYY?
-#define FLAG_MIN ('-16 -16 -24' + '0 0 -13')
-#define FLAG_MAX ('16 16 45' + '0 0 -13')
+#define FLAG_MIN (PL_MIN_CONST + '0 0 -13')
+#define FLAG_MAX (PL_MAX_CONST + '0 0 -13')
 
 const float FLAG_SCALE = 0.6;
 
@@ -27,7 +27,7 @@ const float WPFE_THINKRATE = 0.5;
 
 const vector FLAG_DROP_OFFSET = ('0 0 32');
 const vector FLAG_CARRY_OFFSET = ('-16 0 8');
-#define FLAG_SPAWN_OFFSET ('0 0 1' * (45 - 13))
+#define FLAG_SPAWN_OFFSET ('0 0 1' * (PL_MAX_CONST.z - 13))
 const vector FLAG_WAYPOINT_OFFSET = ('0 0 64');
 const vector FLAG_FLOAT_OFFSET = ('0 0 32');
 const vector FLAG_PASS_ARC_OFFSET = ('0 0 -10');
index 637945608d17b75c969e3c7f0855d5ff0c817cac..089e80a894087b901204644dd96261ba9c08542b 100644 (file)
@@ -68,13 +68,13 @@ void relocate_spawnpoint()
     // nudge off the floor
     setorigin(self, self.origin + '0 0 1');
 
-    tracebox(self.origin, PL_MIN, PL_MAX, self.origin, true, self);
+    tracebox(self.origin, PL_MIN_CONST, PL_MAX_CONST, self.origin, true, self);
     if (trace_startsolid)
     {
         vector o;
         o = self.origin;
-        self.mins = PL_MIN;
-        self.maxs = PL_MAX;
+        self.mins = PL_MIN_CONST;
+        self.maxs = PL_MAX_CONST;
         if (!move_out_of_solid(self))
             objerror("could not get out of solid at all!");
         print("^1NOTE: this map needs FIXING. Spawnpoint at ", vtos(o - '0 0 1'));