Пример #1
0
//------------------------------------------------------------------------
int CScriptBind_Weapon::GetNumOfFireModes(IFunctionHandler *pH)
{
	CWeapon *pWeapon = GetWeapon(pH);
	int nCountFireModes = 0;
	if (pWeapon)
	{
		nCountFireModes = pWeapon->GetNumOfFireModes();
	}
	return pH->EndFunction(nCountFireModes);
}
Пример #2
0
int CScriptBind_Weapon::IsFiring(IFunctionHandler *pH)
{
	CWeapon *pWeapon = GetWeapon(pH);
	if (!pWeapon)
		return pH->EndFunction();

	int n=pWeapon->GetNumOfFireModes();
	for (int i=0;i<n;i++)
	{
		if (IFireMode *pFireMode=pWeapon->GetFireMode(i))
		{
			if (pFireMode->IsEnabled() && pFireMode->IsFiring())
				return pH->EndFunction(true);
		}
	}

	return pH->EndFunction();
}