dont crash

This commit is contained in:
mrbesen 2022-04-26 21:44:16 +02:00
parent 4e515ae8a0
commit d6a36d336a
Signed by: MrBesen
GPG Key ID: 596B2350DCD67504
1 changed files with 3 additions and 1 deletions

View File

@ -112,6 +112,7 @@ LolAutoAccept::~LolAutoAccept() {
void LolAutoAccept::setChamp(const std::string& champ, State s) {
if(s == State::LOBBY || s >= State::GAME) {
Log::warn << "setChamp() called on invalid State";
return;
}
stages.at((int) s)->champ = champ;
@ -120,6 +121,7 @@ void LolAutoAccept::setChamp(const std::string& champ, State s) {
void LolAutoAccept::setEnabled(bool b, State s) {
if(s >= State::GAME) {
Log::warn << "setEnabled() called on invalid State";
return;
}
stages.at((int) s)->enabled = b;
@ -184,7 +186,7 @@ void LolAutoAccept::innerRun() {
cv::resize(img, img, cv::Size(ScreenShot::DEFAULTWIDTH, ScreenShot::DEFAULTHEIGHT));
for(size_t i = 0; i < stages.size(); ++i) {
// Log::trace << "processing stage " << i;
Log::trace << "processing stage " << i;
Stage* stage = stages.at(i);
if(stage->process(*this, img)) {
Log::debug << "stage successful: " << i;