Skip to content

Commit

Permalink
Added strict checks for travel_wait
Browse files Browse the repository at this point in the history
  • Loading branch information
Jon committed Aug 21, 2024
1 parent 5bf30ae commit 7d400f3
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions GuildWarsPartySearch.Bot/gw-helper.c
Original file line number Diff line number Diff line change
Expand Up @@ -338,8 +338,13 @@ static int get_rare_material_trader_id(int map_id)
static int wait_map_loading(int map_id, msec_t timeout_ms);
static int travel_wait(int map_id, District district, uint16_t district_number)
{
if ((GetMapId() == map_id) && (GetDistrict() == district)
&& (GetDistrictNumber() == district_number)) {
int current_map_id = GetMapId();
District current_district = GetDistrict();
int current_district_number = GetDistrictNumber();

if ((current_map_id == map_id)
&& (district == District::DISTRICT_CURRENT || current_district == district)
&& (!district_number || current_district_number == district_number)) {
return 0;
}
RedirectMap(map_id, district, district_number);
Expand Down

0 comments on commit 7d400f3

Please sign in to comment.