CheckMaxAmmoReached prototype

Locked
Rawing
Posts: 107
Joined: Tue Oct 23, 2007 1:40 pm

CheckMaxAmmoReached prototype

Post 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?
[color=#FF0000]/callvote kick all_enemies[/color]
^misantropia^
Posts: 4022
Joined: Sat Mar 12, 2005 6:24 pm

Re: CheckMaxAmmoReached prototype

Post 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.
Locked