Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix range usages #6378

Merged
merged 2 commits into from
Jun 7, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion code/game/turfs/turf.dm
Original file line number Diff line number Diff line change
Expand Up @@ -519,7 +519,7 @@
var/spread = floor(sqrt(size)*1.5)

var/list/turfs = list()
for(var/turf/open/floor/F in range(src,spread))
for(var/turf/open/floor/F in range(spread, src))
turfs += F

switch(A.ceiling)
Expand Down
4 changes: 2 additions & 2 deletions code/modules/admin/topic/topic_events.dm
Original file line number Diff line number Diff line change
Expand Up @@ -191,7 +191,7 @@

var/turf/spawn_turf
if(range_to_spawn_on)
for(spawn_turf in range(initial_turf, range_to_spawn_on))
for(spawn_turf in range(range_to_spawn_on, initial_turf))
if(!spawn_turf || istype(spawn_turf, /turf/closed))
continue
turfs += spawn_turf
Expand Down Expand Up @@ -317,7 +317,7 @@

var/turf/spawn_turf
if(range_to_spawn_on)
for(spawn_turf in range(initial_turf, range_to_spawn_on))
for(spawn_turf in range(range_to_spawn_on, initial_turf))
if(!spawn_turf || istype(spawn_turf, /turf/closed))
continue
turfs += spawn_turf
Expand Down
2 changes: 1 addition & 1 deletion code/modules/cm_marines/dropship_ammo.dm
Original file line number Diff line number Diff line change
Expand Up @@ -244,7 +244,7 @@
/obj/structure/ship_ammo/laser_battery/detonate_on(turf/impact, obj/structure/dropship_equipment/weapon/fired_from)
set waitfor = 0
var/list/turf_list = list()
for(var/turf/T in range(impact, 3)) //This is its area of effect
for(var/turf/T in range(3, impact)) //This is its area of effect
turf_list += T
playsound(impact, 'sound/effects/pred_vision.ogg', 20, 1)
for(var/i=1 to 16) //This is how many tiles within that area of effect will be randomly ignited
Expand Down
2 changes: 1 addition & 1 deletion code/modules/mob/living/carbon/carbon.dm
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@
var/obj/O = A
if(O.unacidable)
O.forceMove(get_turf(loc))
O.throw_atom(pick(range(get_turf(loc), 1)), 1, SPEED_FAST)
O.throw_atom(pick(range(1, get_turf(loc))), 1, SPEED_FAST)

. = ..(cause)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -708,7 +708,7 @@

/datum/action/xeno_action/activable/place_construction/proc/spacecheck(mob/living/carbon/xenomorph/X, turf/T, datum/construction_template/xenomorph/tem)
if(tem.block_range)
for(var/turf/TA in range(T, tem.block_range))
for(var/turf/TA in range(tem.block_range, T))
if(!X.check_alien_construction(TA, FALSE, TRUE))
to_chat(X, SPAN_WARNING("We need more open space to build here."))
qdel(tem)
Expand Down
2 changes: 1 addition & 1 deletion code/modules/organs/limbs.dm
Original file line number Diff line number Diff line change
Expand Up @@ -1522,5 +1522,5 @@ treat_grafted var tells it to apply to grafted but unsalved wounds, for burn kit

owner.visible_message("[owner]'s [owner_helmet] goes flying off from the impact!", SPAN_USERDANGER("Your [owner_helmet] goes flying off from the impact!"))
owner.drop_inv_item_on_ground(owner_helmet)
INVOKE_ASYNC(owner_helmet, TYPE_PROC_REF(/atom/movable, throw_atom), pick(range(get_turf(loc), 1)), 1, SPEED_FAST)
INVOKE_ASYNC(owner_helmet, TYPE_PROC_REF(/atom/movable, throw_atom), pick(range(1, get_turf(loc))), 1, SPEED_FAST)
playsound(owner, 'sound/effects/helmet_noise.ogg', 100)
Loading