]> git.rm.cloudns.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
Merge branch 'master' into TimePath/features/jetpack_jump
authorTimePath <andrew.hardaker1995@gmail.com>
Wed, 24 Dec 2014 03:43:49 +0000 (14:43 +1100)
committerTimePath <andrew.hardaker1995@gmail.com>
Wed, 24 Dec 2014 03:43:49 +0000 (14:43 +1100)
Conflicts:
qcsrc/server/cl_physics.qc

1  2 
defaultXonotic.cfg
qcsrc/menu/xonotic/dialog_settings_input.c
qcsrc/server/cl_client.qc
qcsrc/server/cl_physics.qc
qcsrc/server/t_items.qc

Simple merge
Simple merge
index 34e3e8f5d2791f7705bb70a24eade0e751a2ebaa,08f9dee9562f5c9d91c382236f3f0ea56e84e0bf..900f65bc8ab3dcbbe698f23ab906e7b5320f7601
@@@ -153,41 -151,11 +153,41 @@@ void CheckWaterJump(
                }
        }
  }
 +
 +.float jetpack_stopped;
 +// Hack: shouldn't need to know about this
 +.float multijump_count;
  void CheckPlayerJump()
  {
 -      if (self.BUTTON_JUMP)
 -              PlayerJump ();
 +      float was_flying = self.items & IT_USING_JETPACK;
 +
 +      if (self.cvar_cl_jetpack_jump < 2)
 +              self.items &= ~IT_USING_JETPACK;
 +
 +      if (self.BUTTON_JUMP || self.BUTTON_JETPACK)
 +      {
 +              float air_jump = !PlayerJump() || self.multijump_count > 0; // PlayerJump() has important side effects
 +              float activate = self.cvar_cl_jetpack_jump && air_jump && self.BUTTON_JUMP || self.BUTTON_JETPACK;
 +              float has_fuel = !autocvar_g_jetpack_fuel || self.ammo_fuel || self.items & IT_UNLIMITED_WEAPON_AMMO;
 +              if (self.jetpack_stopped) { }
 +              else if (!has_fuel)
 +              {
-                       if (was_flying)
-                               sprint(self, "You ran out of fuel for the ^2Jetpack\n");
++                      if (was_flying) // TODO: ran out of fuel message
++                              Send_Notification(NOTIF_ONE, self, MSG_INFO, INFO_JETPACK_NOFUEL);
 +                      else
-                               sprint(self, "You don't have any fuel for the ^2Jetpack\n");
++                              Send_Notification(NOTIF_ONE, self, MSG_INFO, INFO_JETPACK_NOFUEL);
 +                      self.jetpack_stopped = TRUE;
 +                      self.items &= ~IT_USING_JETPACK;
 +              }
 +              else if (activate && !self.frozen)
 +                      self.items |= IT_USING_JETPACK;
 +      }
        else
 +      {
 +              self.jetpack_stopped = FALSE;
 +              self.items &= ~IT_USING_JETPACK;
 +      }
 +      if (!self.BUTTON_JUMP)
                self.flags |= FL_JUMPRELEASED;
  
        if (self.waterlevel == WATERLEVEL_SWIMMING)
Simple merge