A_GiveWeapon is an action that gives the target player one or more weapon panels and plays the actor's
SeeSound. Var1 determines the weapon flag number according to the list below. The flag values can be combined to give the player multiple weapon panels at once. Note that this action only gives the ability to use the weapons; it does not supply the ammo for them.
Code – A_GiveWeapon
// Function: A_GiveWeapon
// Description: Gives the player the specified weapon panels.
// var1 = Weapon index #
// var2 = unused
void A_GiveWeapon(mobj_t *actor)
INT32 locvar1 = var1;
if (LUA_CallAction("A_GiveWeapon", actor))
if (!actor->target || !actor->target->player)
CONS_Debug(DBG_GAMELOGIC, "Powerup has no target.\n");
if (locvar1 >= 1<<(NUM_WEAPONS-1))
CONS_Debug(DBG_GAMELOGIC, "Weapon #%d out of range!\n", locvar1);
player = actor->target->player;
player->ringweapons |= locvar1;