A_ClearReFire

From ZDoom Wiki
Jump to navigation Jump to search

A_ClearReFire

(no parameters)

Usage

Normally, when A_ReFire is encountered, ZDoom jumps to the Fire/AltFire state unless a specific state is defined, or a Hold/AltHold state is found, provided that the appropriate fire button is being pressed. For weapons where it may be desirable to return to the Fire/AltFire state, and the player has been holding the appropriate fire button down continually, the A_ClearReFire function can be used to send the weapon back to the Fire/AltFire state.

A_ReFire can take a state parameter, allowing it to be much more flexible.

Examples

This is a weapon that uses A_ClearReFire to continue the chaingun animation.

Actor NewChaingun : Chaingun
{
	States
	{
	Fire:
		CHGG A 4 A_FireCGun
		CHGG A 0 A_ReFire
		Goto Ready
	Hold:
		CHGG B 4 A_FireCGun
		CHGG B 0 A_ClearReFire //A_ReFire("Fire")
		Goto Ready
	}
}