vgstation-coders / vgstation13

Butts
GNU General Public License v3.0
260 stars 542 forks source link

quick_AStar's "return list()" counts for if() checks #33955

Open boy2mantwicethefam opened 1 year ago

boy2mantwicethefam commented 1 year ago

While testing #33954 I've noticed that nothing really got fixed by the PR. After turning on the AStar debug mode and trying to see what's actually wrong in-game (AStar didn't actually reach the target but it still confirmed that it succeeded, it made a lot of orange tiles though even if the range was supposed to be small) I eventually changed it from checking for whether quick_AStar succeeds to whether the list that quick_AStar returns has entries, which seems to have fixed it. This interaction might break other things that rely on if(quick_AStar()) checks like:

code/datums/disease.dm, line 148 if(isturf(M.loc) && quick_AStar(source.loc, M, /turf/proc/AdjacentTurfs, /turf/proc/Distance, check_range, reference="\ref[src]")) code/modules/spells/aoe_turf/conjure/bats.dm, line 35 if(quick_AStar(user.loc, T, /turf/proc/AdjacentTurfs, /turf/proc/Distance, 1, reference="\ref[src]")) code/modules/spells/aoe_turf/conjure/pitbulls.dm, line 34 if(quick_AStar(get_turf(user), T, /turf/proc/AdjacentTurfs, /turf/proc/Distance, 1, reference="\ref[src]"))

boy2mantwicethefam commented 1 year ago

@ShiftyRail