Closed NanakoAC closed 4 years ago
Same problem also exists in code/modules/blob/blob.dm, line 124
`if(!(locate(/obj/effect/blob/core) in range(T, 2)) && prob(secondary_core_growth_chance))`
Same problem in simple_animal/friendly/cat.dm, line 67
var/mob/observer/ghost/spook = locate() in range(src,5)
According to the reference for range()
Both arguments are optional and may be passed in any order.
If it isn't causing a bug, it should be working properly.
at the very least, it breaks the standard. All the view/range procs are written to take distance first and it should conform to that. The vast majority of uses in the codebase are written with distance first, this is a handful of niche exceptions
call it a minor code cleanup issue, but i still want this sorted. i'm doing it locally anyway, may send my changes upstream
code/game/machinery/cryopod.dm, line 226
for(var/obj/effect/overmap/OO in physical_range(O,2))
gamemodes/events.dm, line 73
for(var/obj/machinery/power/apc/apc in range(epicentre,lightsoutRange))
retaliate/exoplanet.dm, 30
for(var/mob/living/simple_animal/S in range(src,1))
gravitygenerator.dm, 41
for(var/area/A in range(src,effectiverange))
modules/mob/living/living.dm, 79
for(var/mob/living/M in range(tmob, 1))
mining/mine_turfs.dm, 312
for(var/mob/living/M in range(src, 200))
datums/movement/mob.dm, 203
for(var/mob/M in range(mob, 1))
modules/overmap/overmap_shuttle.dm, 65
for (var/obj/effect/overmap/S in range(get_turf(waypoint_sector(current_location)), range))
targeted/projectile/projectile.dm, 42
for(var/mob/living/M in range(spell_holder, cast_prox_range))
modules/spells/spell_code.dm, 237
for(var/turf/T in range(holder, 1))
game/turfs/turf_ao.dm, 21
for(var/turf/T in RANGE_TURFS(src, 1))
__defines/turfs.dm, 21
#define RANGE_TURFS(CENTER, RADIUS) block(locate(max(CENTER.x-(RADIUS), 1), max(CENTER.y-(RADIUS),1), CENTER.z), locate(min(CENTER.x+(RADIUS), world.maxx), min(CENTER.y+(RADIUS), world.maxy), CENTER.z))
This is different from the others but this define is breaking the standard too. there's only about four uses of it across the codebase, so its parameters should be swapped to bring it in line
mechs/equipment/utility.dm, 180
atoms = range(target,3)
several more uses in this file
turfs/simulated/walls.dm, 110
for(var/obj/effect/vine/plant in range(src, 1))
objects/structures/window.dm, 522
for(var/obj/structure/window/W in range(src,range))
that's the last of them
This is not a bug. Don't spam further instances, please. Either order is valid.
In turf_changing.dm, line 79 ish we have this
for(var/turf/space/S in range(W,1)) S.update_starlight()
The inputs for range are in the wrong order. It takes distance first, origin point second. That should read
for(var/turf/space/S in range(1, W)) S.update_starlight()