mirror of
https://github.com/Bubberstation/Bubberstation.git
synced 2026-08-23 21:18:37 +01:00
Cleanup (#58234)
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:
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
|
||||
Reference in New Issue
Block a user