total_ammo_count = AMMO_COUNT;
bool infinite_ammo = (STAT(ITEMS) & IT_UNLIMITED_AMMO);
- bool have_hook = (WepSet_GetFromStat() & WEPSET(HOOK)) != '0 0 0';
+
+ bool show_fuel = false;
+ int have_hook;
+ if (mut_is_active(MUT_GRAPPLING_HOOK))
+ {
+ have_hook = 2; // off-hand hook
+ if (STAT(HOOK_FUEL))
+ show_fuel = true;
+ }
+ else
+ {
+ have_hook = ((WepSet_GetFromStat() & WEPSET(HOOK)) != '0 0 0') ? 1 : 0;
+ if (have_hook && WEP_CVAR_PRI(WEP_HOOK, ammo))
+ show_fuel = true;
+ }
+
bool have_jetpack = boolean(STAT(ITEMS) & IT_JETPACK);
+ if (have_jetpack && STAT(JETPACK_FUEL))
+ show_fuel = true;
+
+ if (!show_fuel)
+ show_fuel = (STAT(FUEL) || infinite_ammo);
- // always show fuel if we have jetpack or off-hand hook
- bool show_fuel = (STAT(FUEL) || infinite_ammo || have_jetpack || have_hook);
if (show_fuel)
++total_ammo_count;
if (!show_fuel)
continue;
if (!isCurrent)
- isCurrent = have_jetpack; // jetpack can be used anytime
+ isCurrent = (have_jetpack || have_hook == 2); // these tools can be used anytime
}
DrawAmmoItem(
// can't use the autocvar as it doesn't work in the campaign
//AUTOCVAR(g_grappling_hook, bool, false, "let players spawn with the grappling hook which allows them to pull themselves up");
#ifdef SVQC
-AUTOCVAR(g_grappling_hook_useammo, bool, false, "Use ammunition with the off-hand grappling hook");
-
REGISTER_MUTATOR(hook, expr_evaluate(cvar_string("g_grappling_hook"))) {
MUTATOR_ONADD {
g_grappling_hook = true;
REGISTER_STAT(JETPACK_MAXSPEED_UP, float, autocvar_g_jetpack_maxspeed_up)
REGISTER_STAT(JETPACK_REVERSE_THRUST, float, autocvar_g_jetpack_reverse_thrust)
+#ifdef SVQC
+float autocvar_g_grappling_hook_useammo;
+#endif
+REGISTER_STAT(HOOK_FUEL, bool, autocvar_g_grappling_hook_useammo)
+
REGISTER_STAT(MOVEVARS_HIGHSPEED, float)
#ifdef SVQC