prev_health = 0;
prev_armor = 0;
}
- fuel = getstati(STAT_FUEL);
+ fuel = STAT(FUEL);
}
else
{
bool IsFlying(entity a);
+#define PHYS_AMMO_FUEL(s) STAT(FUEL, s)
+
#ifdef CSQC
const int FL_WATERJUMP = 2048; // player jumping out of water
#define ITEMS_STAT(s) (s).items
#define BUFFS_STAT(s) getstati(STAT_BUFFS)
- #define PHYS_AMMO_FUEL(s) getstati(STAT_FUEL)
-
#define PHYS_FROZEN(s) getstati(STAT_FROZEN)
#define PHYS_DOUBLEJUMP getstati(STAT_DOUBLEJUMP)
#define ITEMS_STAT(s) s.items
#define BUFFS_STAT(s) (s).buffs
- #define PHYS_AMMO_FUEL(s) s.ammo_fuel
-
#define PHYS_FROZEN(s) s.frozen
#define PHYS_DOUBLEJUMP autocvar_sv_doublejump
STAT_LAST_VECTOR
};
-const int REGISTERED_STATS = 8;
+const int REGISTERED_STATS = 9;
REGISTER_STAT(KH_KEYS, int)
/** weapon requested to switch to; next WANTED weapon (for HUD) */
REGISTER_STAT(PRESSED_KEYS, int)
/** this stat could later contain some other bits of info, like, more server-side particle config */
REGISTER_STAT(ALLOW_OLDVORTEXBEAM, bool)
+REGISTER_STAT(FUEL, int)
enum {
STAT_FIRST_MAIN = (STAT_LAST_VECTOR - 1) + REGISTERED_STATS,
- STAT_FUEL,
STAT_NB_METERSTART,
/** compressShotOrigin */ STAT_SHOTORG,
STAT_LEADLIMIT,
case ammo_rockets: return STAT_ROCKETS;
case ammo_cells: return STAT_CELLS;
case ammo_plasma: return STAT_PLASMA;
- case ammo_fuel: return STAT_FUEL;
+ case ammo_fuel: return STAT_FUEL.m_id;
default: return -1;
}
}
#ifndef WEAPON_H
#define WEAPON_H
#include "../items/item/pickup.qh"
+#include "../stats.qh"
const int MAX_WEAPONSLOTS = 2;
.entity weaponentities[MAX_WEAPONSLOTS];
return 0;
}
+#ifdef SVQC
+.int ammo_shells;
+.int ammo_nails;
+.int ammo_rockets;
+.int ammo_cells;
+.int ammo_plasma;
+.int ammo_fuel = _STAT(FUEL);
+.int ammo_none;
+#else
.int ammo_shells;
.int ammo_nails;
.int ammo_rockets;
.int ammo_plasma;
.int ammo_fuel;
.int ammo_none;
+#endif
/** fields which are explicitly/manually set are marked with "M", fields set automatically are marked with "A" */
CLASS(Weapon, Object)
Nagger_Init();
addstat(STAT_SUPERWEAPONS_FINISHED, AS_FLOAT, superweapons_finished);
- addstat(STAT_FUEL, AS_INT, ammo_fuel);
addstat(STAT_PLASMA, AS_INT, ammo_plasma);
addstat(STAT_SHOTORG, AS_INT, stat_shotorg);
addstat(STAT_LEADLIMIT, AS_FLOAT, stat_leadlimit);