I adding a MG42,but use an ammos (normal ammo,shells). How to fixed not use an ammos?
WL_AGENT.CPP:
WL_AGENT.CPP:
- Code:
case -1:
ob->state = &s_player;
if (!gamestate.ammo && gamestate.weapon == wp_pistol ||
!gamestate.ammo && gamestate.weapon == wp_machinegun ||
!gamestate.ammo && gamestate.weapon == wp_chaingun ||
!gamestate.shells && gamestate.weapon == wp_flakgun ||
!gamestate.fuel && gamestate.weapon == wp_flame)
{
gamestate.weapon = gamestate.chosenweapon = wp_knife;
DrawWeapon ();
}
else
{
if (gamestate.weapon != wp_mg42_mounted &&
gamestate.weapon != gamestate.chosenweapon)
{
gamestate.weapon = gamestate.chosenweapon;
DrawWeapon ();
}
}
gamestate.attackframe = gamestate.weaponframe = 0;
return;
case 4:
case 6:
if (!gamestate.ammo && !gamestate.shells && !gamestate.fuel)
break;
if (buttonstate[bt_attack])
gamestate.attackframe -= 2;
case 1:
if (!gamestate.ammo && gamestate.weapon == wp_pistol ||
!gamestate.ammo && gamestate.weapon == wp_machinegun ||
!gamestate.ammo && gamestate.weapon == wp_chaingun ||
!gamestate.shells && gamestate.weapon == wp_flakgun ||
!gamestate.fuel && gamestate.weapon == wp_flame)
{ // can only happen with chain gun
gamestate.attackframe++;
break;
}
GunAttack (ob);
if (gamestate.chosenweapon == wp_pistol)
{
gamestate.ammo--;
DrawAmmo ();
}
if (gamestate.chosenweapon == wp_machinegun)
{
gamestate.ammo--;
DrawAmmo ();
}
if (gamestate.chosenweapon == wp_chaingun)
{
gamestate.ammo--;
DrawAmmo ();
}
if (gamestate.chosenweapon == wp_flakgun)
{
gamestate.shells--;
DrawAmmo ();
}
break;
case 2:
KnifeAttack (ob);
break;
case 3:
if (gamestate.ammo && buttonstate[bt_attack])
gamestate.attackframe -= 2;
break;
case 5:
if (buttonstate[bt_attack])
gamestate.attackframe -= 4;
break;
case 7:
if (gamestate.shells && buttonstate[bt_attack])
gamestate.attackframe -= 2;
break;