Reset player action in pause menu for network, fix #3230

This commit is contained in:
Benau 2018-05-02 15:37:47 +08:00
parent f5035a00ea
commit a5b234ceef

View File

@ -25,6 +25,8 @@
#include "guiengine/scalable_font.hpp"
#include "guiengine/widgets/icon_button_widget.hpp"
#include "guiengine/widgets/ribbon_widget.hpp"
#include "karts/controller/controller.hpp"
#include "karts/kart.hpp"
#include "input/input_manager.hpp"
#include "io/file_manager.hpp"
#include "modes/overworld.hpp"
@ -66,6 +68,18 @@ RacePausedDialog::RacePausedDialog(const float percentWidth,
{
music_manager->pauseMusic();
SFXManager::get()->pauseAll();
for (unsigned i = 0; i < World::getWorld()->getNumKarts(); i++)
{
for (unsigned j = 0; j < PA_PAUSE_RACE; j++)
{
if (World::getWorld()->getKart(i)->isEliminated() ||
!World::getWorld()->getKart(i)->getController()
->isLocalPlayerController())
break;
World::getWorld()->getKart(i)->getController()
->action((PlayerAction)j, 0);
}
}
}
else
{