]> git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/blobdiff - qcsrc/server/t_jumppads.qc
Merge remote-tracking branch 'origin/master' into samual/notification_updates
[xonotic/xonotic-data.pk3dir.git] / qcsrc / server / t_jumppads.qc
index 0b6f7fc4cd9488357ccb0b0110adf3adf87a18ec..0efb77df276ae2154a8127458e5695b2ecb0b53d 100644 (file)
@@ -71,7 +71,7 @@ vector trigger_push_calculatevelocity(vector org, entity tgt, float ht)
         */
 
        // push him so high...
-       vz = sqrt(2 * grav * jumpheight); // NOTE: sqrt(positive)!
+       vz = sqrt(fabs(2 * grav * jumpheight)); // NOTE: sqrt(positive)!
 
        // we start with downwards velocity only if it's a downjump and the jump apex should be outside the jump!
        if(ht < 0)
@@ -166,7 +166,7 @@ void trigger_push_touch()
 
        other.flags &~= FL_ONGROUND;
 
-       if (other.classname == "player")
+       if (IS_PLAYER(other))
        {
                // reset tracking of oldvelocity for impact damage (sudden velocity changes)
                other.oldvelocity = other.velocity;
@@ -178,9 +178,7 @@ void trigger_push_touch()
                        sound (other, CH_TRIGGER, self.noise, VOL_BASE, ATTN_NORM);
                        self.pushltime = time + 0.2;
                }
-               float ct;
-               ct = clienttype(other);
-               if( ct == CLIENTTYPE_REAL || ct == CLIENTTYPE_BOT)
+               if(IS_REAL_CLIENT(other) || IS_BOT_CLIENT(other))
                {
                        float i;
                        float found;
@@ -194,7 +192,7 @@ void trigger_push_touch()
                                other.jumppadcount = other.jumppadcount + 1;
                        }
 
-                       if(ct == CLIENTTYPE_REAL)
+                       if(IS_REAL_CLIENT(other))
                        {
                                if(self.message)
                                        centerprint(other, self.message);