All pastes #734143 Raw Edit

Someone

public c v1 · immutable
·published 2007-10-12 12:52 UTC
rendered paste body
static void CL_GetWeaponAndAmmo (le_t *actor, char hand, objDef_t **weapon, objDef_t **ammo, int *weap_fd_idx){	invList_t *invlist_weapon = NULL;	objDef_t *item, *itemAmmo;	if (!actor)		return;	if (hand == 'r')		invlist_weapon = RIGHT(actor);	else		invlist_weapon = LEFT(actor);	if (!invlist_weapon || invlist_weapon->item.t == NONE)		return;	item = &csi.ods[invlist_weapon->item.t];	if (!item)		return;	if (item->numWeapons) /* @todo: "|| invlist_weapon->item.m == NONE" ... actually what does a negative number for ammo mean? */		itemAmmo = item; /* This weapon doesn't need ammo it already has firedefs */	else		itemAmmo = &csi.ods[invlist_weapon->item.m];	*weap_fd_idx = FIRESH_FiredefsIDXForWeapon(itemAmmo, invlist_weapon->item.t);	if (ammo)		*ammo = itemAmmo;	if (weapon)		*weapon = item;}