as x doesn't work properly when used in for loops over special lists.

One instance of as anything in get_turf() in crafting code was removed as entirely redundant. It was an untyped for loop anyway.

Two instances of as anything in contents changed for wheelchairs with warnings added to change them to as anything loops when we upgrade to 514.
This commit is contained in:
Timberpoes
2021-04-09 02:31:45 -07:00
committed by GitHub
parent 5bd39b9189
commit 232fb90388
2 changed files with 13 additions and 5 deletions
+1 -1
View File
@@ -196,7 +196,7 @@
if(check_contents(a, R, contents))
if(check_tools(a, R, contents))
if(R.one_per_turf)
for(var/content as anything in get_turf(a))
for(var/content in get_turf(a))
if(istype(content, R.result))
return ", object already present."
//If we're a mob we'll try a do_after; non mobs will instead instantly construct the item
+12 -4
View File
@@ -39,8 +39,12 @@
/obj/vehicle/ridden/wheelchair/motorized/obj_destruction(damage_flag)
var/turf/T = get_turf(src)
for(var/atom/movable/thing as anything in contents)
thing.forceMove(T)
#if MIN_COMPILER_VERSION >= 514
#warn Please replace the loop below this warning with an `as anything` loop.
#endif
for(var/wheelchair_content in contents)
var/atom/movable/atom_content = wheelchair_content
atom_content.forceMove(T)
return ..()
/obj/vehicle/ridden/wheelchair/motorized/relaymove(mob/living/user, direction)
@@ -116,8 +120,12 @@
new /obj/item/stack/rods(drop_location(), 8)
new /obj/item/stack/sheet/iron(drop_location(), 10)
var/turf/T = get_turf(src)
for(var/atom/movable/thing as anything in contents)
thing.forceMove(T)
#if MIN_COMPILER_VERSION >= 514
#warn Please replace the loop below this warning with an `as anything` loop.
#endif
for(var/wheelchair_content in contents)
var/atom/movable/atom_content = wheelchair_content
atom_content.forceMove(T)
qdel(src)
return TRUE