diff --git a/code/game/atoms_movable.dm b/code/game/atoms_movable.dm index 9704fbb28da..b405569d67a 100644 --- a/code/game/atoms_movable.dm +++ b/code/game/atoms_movable.dm @@ -992,13 +992,7 @@ /* End language procs */ - -/atom/movable/proc/ConveyorMove(movedir) - set waitfor = FALSE - if(!anchored && has_gravity()) - step(src, movedir) - -///Returns an atom's power cell, if it has one. Overload for individual items. +//Returns an atom's power cell, if it has one. Overload for individual items. /atom/movable/proc/get_cell() return diff --git a/code/game/objects/effects/effects.dm b/code/game/objects/effects/effects.dm index b9a36855442..e3cbbaf642d 100644 --- a/code/game/objects/effects/effects.dm +++ b/code/game/objects/effects/effects.dm @@ -43,9 +43,6 @@ /obj/effect/singularity_act() qdel(src) -/obj/effect/ConveyorMove() - return - /obj/effect/abstract/ex_act(severity, target) return diff --git a/code/modules/mob/dead/dead.dm b/code/modules/mob/dead/dead.dm index 2a51822c5c1..dfe69566189 100644 --- a/code/modules/mob/dead/dead.dm +++ b/code/modules/mob/dead/dead.dm @@ -31,9 +31,6 @@ INITIALIZE_IMMEDIATE(/mob/dead) /mob/dead/gib() //ghosts can't be gibbed. return -/mob/dead/ConveyorMove() //lol - return - /mob/dead/forceMove(atom/destination) var/turf/old_turf = get_turf(src) var/turf/new_turf = get_turf(destination) diff --git a/code/modules/mob/living/living.dm b/code/modules/mob/living/living.dm index 607490e1b26..b2f77a04a2e 100644 --- a/code/modules/mob/living/living.dm +++ b/code/modules/mob/living/living.dm @@ -1209,11 +1209,6 @@ "[C] leaps out of [src]'s way!")]") C.Paralyze(40) -/mob/living/ConveyorMove() - if((movement_type & FLYING) && !stat) - return - ..() - /mob/living/can_be_pulled() return ..() && !(buckled && buckled.buckle_prevents_pull) diff --git a/code/modules/recycling/conveyor2.dm b/code/modules/recycling/conveyor2.dm index 8061594a2f7..6f72fe48d7e 100644 --- a/code/modules/recycling/conveyor2.dm +++ b/code/modules/recycling/conveyor2.dm @@ -16,8 +16,6 @@ GLOBAL_LIST_EMPTY(conveyors_by_id) var/forwards // this is the default (forward) direction, set by the map dir var/backwards // hopefully self-explanatory var/movedir // the actual direction to move stuff in - - var/list/affecting // the list of all items that will be moved this ptick var/id = "" // the control ID - must match controller ID var/verted = 1 // Inverts the direction the conveyor belt moves. var/conveying = FALSE @@ -61,7 +59,7 @@ GLOBAL_LIST_EMPTY(conveyors_by_id) /obj/machinery/conveyor/Destroy() LAZYREMOVE(GLOB.conveyors_by_id[id], src) - . = ..() + return ..() /obj/machinery/conveyor/vv_edit_var(var_name, var_value) if (var_name == NAMEOF(src, id)) @@ -138,24 +136,36 @@ GLOBAL_LIST_EMPTY(conveyors_by_id) use_power(6) //get the first 30 items in contents - affecting = list() - var/i = 0 - var/list/items = loc.contents - src - for(var/item in items) - i++ // we're sure it's a real target to move at this point - if(i >= MAX_CONVEYOR_ITEMS_MOVE) - break - affecting.Add(item) - + var/turf/locturf = loc + var/list/items = locturf.contents - src - locturf.lighting_object + if(!LAZYLEN(items))//Dont do anything at all if theres nothing there but the conveyor + return + var/list/affecting + if(length(items) > MAX_CONVEYOR_ITEMS_MOVE) + affecting = items.Copy(1, MAX_CONVEYOR_ITEMS_MOVE + 1)//Lists start at 1 lol + else + affecting = items conveying = TRUE - addtimer(CALLBACK(src, .proc/convey, affecting), 1) + + addtimer(CALLBACK(src, .proc/convey, affecting), 1)//Movement effect /obj/machinery/conveyor/proc/convey(list/affecting) - for(var/atom/movable/A in affecting) - if(!QDELETED(A) && (A.loc == loc)) - A.ConveyorMove(movedir) - //Give this a chance to yield if the server is busy - stoplag() + for(var/am in affecting) + if(!ismovable(am)) //This is like a third faster than for(var/atom/movable in affecting) + continue + var/atom/movable/movable_thing = am + //Give this a chance to yield if the server is busy + stoplag() + if(QDELETED(movable_thing) || (movable_thing.loc != loc)) + continue + if(iseffect(movable_thing) || isdead(movable_thing)) + continue + if(isliving(movable_thing)) + var/mob/living/zoommob = movable_thing + if((zoommob.movement_type & FLYING) && !zoommob.stat) + continue + if(!movable_thing.anchored && movable_thing.has_gravity()) + step(movable_thing, movedir) conveying = FALSE // attack with item, place item on conveyor