Page 1 of 1

CheckMaxAmmoReached prototype

Posted: Sat Jan 31, 2009 10:36 am
by Rawing
I've done a function that's called everytime you pick ammo or a weapon; it just checks if you've reached the max ammo value and returns the highest amount you can pick up. Doesn't matter anyway lol. I'd like to use it in BG_CanItemBeGrabbed to check if you ammo/weapon should be picked up. It's done in g_items.c so Add_Ammo can use it. The problem is, bg_misc(with BG_CanItemBeGrabbed inside) is compiled in cgame too, and it doesn't know a function called CheckMaxAmmoReached.
I tried to add it's prototype to bg_public.h:

Code: Select all

int CheckMaxAmmoReached( gentity_t *ent, int weapon, int count);
There are like a dozen crazy errors now: "skipping *, ent, ," or "found * expected (" or other weird stuff. Can't compile bg_misc.c into cgame too... Is that weird or what?

Re: CheckMaxAmmoReached prototype

Posted: Mon Feb 02, 2009 11:58 am
by ^misantropia^
Nope, it's simply expected behaviour: gentity_t is only defined for the server component, i.e. game/ - the closest thing you'll find client side is centity_t.