Skip to content

Commit

Permalink
catch changes to last monster and reset counter when it changes.
Browse files Browse the repository at this point in the history
  • Loading branch information
taltamir committed Sep 4, 2023
1 parent fb2c183 commit d0df789
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion RELEASE/scripts/autoscend/auto_post_adv.ash
Original file line number Diff line number Diff line change
Expand Up @@ -1077,11 +1077,18 @@ boolean auto_post_adventure()
//works with code found in auto_pre_adv.ash
if(my_session_adv() == get_property("_auto_inf_session_adv").to_int())
{
auto_log_debug("auto_post_adv.ash detected that no adventure was spent");
auto_log_debug("auto_post_adv.ash detected that no adventure was spent since last auto_pre_adv.ash");
//count how many times in a row we went with no adv spent
set_property("_auto_inf_counter", get_property("_auto_inf_counter").to_int()+1);
//if last monster changed it means we are doing free combats
if(get_property("_auto_inf_last_monster").to_monster() != last_monster())
{
remove_property("_auto_inf_counter"); //reset counter
}
set_property("_auto_inf_last_monster", last_monster());
if(get_property("_auto_inf_counter").to_int() >= 30)
{
auto_log_error("no adventure was spent " +get_property("_auto_inf_counter")+ " times in a row which suggests we are stuck in an infinite loop. Stopping autoscend");
Expand Down

0 comments on commit d0df789

Please sign in to comment.