afegida la opció de controlar el autofire

This commit is contained in:
2024-08-03 17:55:18 +02:00
parent 657d43de5a
commit 1f4d7ce042
4 changed files with 15 additions and 4 deletions

View File

@@ -2235,6 +2235,7 @@ void Game::checkInput()
int i = 0;
for (auto player : players)
{
const bool autofire = player->isPowerUp() || options->game.autofire;
if (player->isAlive() && player->isEnabled())
{
// Input a la izquierda
@@ -2265,7 +2266,7 @@ void Game::checkInput()
}
}
// Comprueba el input de disparar al centro
if (input->checkInput(input_fire_center, ALLOW_REPEAT, options->controller[i].deviceType, options->controller[i].index))
if (input->checkInput(input_fire_center, autofire, options->controller[i].deviceType, options->controller[i].index))
{
if (player->canFire())
{
@@ -2282,7 +2283,7 @@ void Game::checkInput()
}
// Comprueba el input de disparar a la izquierda
else if (input->checkInput(input_fire_left, ALLOW_REPEAT, options->controller[i].deviceType, options->controller[i].index))
else if (input->checkInput(input_fire_left, autofire, options->controller[i].deviceType, options->controller[i].index))
{
if (player->canFire())
{
@@ -2299,7 +2300,7 @@ void Game::checkInput()
}
// Comprueba el input de disparar a la derecha
else if (input->checkInput(input_fire_right, ALLOW_REPEAT, options->controller[i].deviceType, options->controller[i].index))
else if (input->checkInput(input_fire_right, autofire, options->controller[i].deviceType, options->controller[i].index))
{
if (player->canFire())
{