>>82
struct _weapon {
const signed char TYPE_MELEE = 0;
const signed char TYPE_PROJECTILE = 1;
const signed char TYPE_SPECIAL = 2;
const signed char DEFAULT_TYPE = -1;
const int DEFAULT_AMMO = -2;
const int DEFAULT_DAMAGE = -2147483648;
unsigned int id = 0;
int damage = DEFAULT_DAMAGE;
signed char type = DEFAULT_TYPE;
int ammo = DEFAULT_AMMO;
} weapon;
This allows you to compare against known default values if necessary. I forget if C has Sepples-esque
const or if you shove
static in there. Either way, it's an improvement on your code tagless shit.
There are some other things you could do, like using type as an enum or something, but I felt that it wasn't necessary for the purposes here and an enum tends to be a replacement for int. Since you want as little byte storage as possible, char constants are probably better.