Skip to content

Commit ecb26a5

Browse files
committed
Fix the SwSh auto-host not starting when everyone is ready.
1 parent 778166a commit ecb26a5

File tree

3 files changed

+9
-6
lines changed

3 files changed

+9
-6
lines changed

SerialPrograms/Source/PokemonSwSh/Commands/PokemonSwSh_Commands_AutoHosts.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,7 @@ void accept_FRs(
9494
// Return to Switch Home menu. (or game)
9595
if (stream.video().snapshot()){
9696
stream.log("Entering game using inference...");
97-
pbf_press_button(context, BUTTON_HOME, 10, 190);
97+
pbf_press_button(context, BUTTON_HOME, 20, 180);
9898
NintendoSwitch::resume_game_from_home(stream, context);
9999
}else{
100100
stream.log("Entering game without inference...", COLOR_RED);

SerialPrograms/Source/PokemonSwSh/Programs/Hosting/PokemonSwSh_AutoHost-Rolling.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -163,7 +163,7 @@ void AutoHostRolling::program(SingleSwitchProgramEnvironment& env, ProController
163163
grip_menu_connect_go_home(context);
164164
}else{
165165
pbf_press_button(context, BUTTON_B, 5, 5);
166-
ssf_press_button_ptv(context, BUTTON_HOME, GameSettings::instance().GAME_TO_HOME_DELAY_FAST0);
166+
ssf_press_button_ptv(context, BUTTON_HOME, GameSettings::instance().GAME_TO_HOME_DELAY_FAST0, 160ms);
167167
}
168168

169169
if (SKIPS == 0){
@@ -195,7 +195,7 @@ void AutoHostRolling::program(SingleSwitchProgramEnvironment& env, ProController
195195
);
196196

197197
// Exit game.
198-
ssf_press_button(context, BUTTON_HOME, GameSettings::instance().GAME_TO_HOME_DELAY_SAFE0, 80ms);
198+
ssf_press_button(context, BUTTON_HOME, GameSettings::instance().GAME_TO_HOME_DELAY_SAFE0, 160ms);
199199
close_game(env.console, context);
200200

201201
// Post-raid delay.

SerialPrograms/Source/PokemonSwSh/Programs/Hosting/PokemonSwSh_LobbyWait.h

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,11 +11,14 @@
1111
#include "CommonFramework/Tools/VideoStream.h"
1212
#include "NintendoSwitch/Controllers/NintendoSwitch_ProController.h"
1313
#include "NintendoSwitch/NintendoSwitch_Settings.h"
14-
#include "NintendoSwitch/Commands/NintendoSwitch_Commands_PushButtons.h"
1514
#include "PokemonSwSh/PokemonSwSh_Settings.h"
1615
#include "PokemonSwSh/Commands/PokemonSwSh_Commands_AutoHosts.h"
1716
#include "PokemonSwSh/Inference/Dens/PokemonSwSh_RaidLobbyReader.h"
1817

18+
//#include <iostream>
19+
//using std::cout;
20+
//using std::endl;
21+
1922
namespace PokemonAutomation{
2023
namespace NintendoSwitch{
2124
namespace PokemonSwSh{
@@ -76,7 +79,7 @@ static RaidLobbyState raid_lobby_wait(
7679
if (state.valid && state.raid_is_full() && state.raiders_are_ready()){
7780
return state;
7881
}
79-
if (current_time() > deadline_lobby_limit){
82+
if (current_time() > deadline_start_time){
8083
break;
8184
}
8285
context.wait_for(std::chrono::milliseconds(1000));
@@ -88,7 +91,7 @@ static RaidLobbyState raid_lobby_wait(
8891
if (!state.valid || state.raiders_are_ready()){
8992
return state;
9093
}
91-
if (current_time() > deadline_start_time){
94+
if (current_time() > deadline_lobby_limit){
9295
return state;
9396
}
9497
context.wait_for(std::chrono::milliseconds(1000));

0 commit comments

Comments
 (0)