diff --git a/code/game/atoms_movable.dm b/code/game/atoms_movable.dm index 3bd7a79ad26c..6cd88d760c65 100644 --- a/code/game/atoms_movable.dm +++ b/code/game/atoms_movable.dm @@ -934,11 +934,6 @@ /* 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. /atom/movable/proc/get_cell() return @@ -982,4 +977,4 @@ M.Turn(pick(-30, 30)) animate(I, alpha = 175, pixel_x = to_x, pixel_y = to_y, time = 3, transform = M, easing = CUBIC_EASING) sleep(1) - animate(I, alpha = 0, transform = matrix(), time = 1) \ No newline at end of file + animate(I, alpha = 0, transform = matrix(), time = 1) diff --git a/code/game/objects/effects/effects.dm b/code/game/objects/effects/effects.dm index 6057d1b41806..e9957150fb7f 100644 --- a/code/game/objects/effects/effects.dm +++ b/code/game/objects/effects/effects.dm @@ -46,9 +46,6 @@ qdel(src) return 0 -/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 9e9a9d26a0c1..3d1aa52ca582 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 57872cf676d6..142c020ef231 100644 --- a/code/modules/mob/living/living.dm +++ b/code/modules/mob/living/living.dm @@ -1077,11 +1077,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 52dc24f9d8ae..15f54fc81615 100644 --- a/code/modules/recycling/conveyor2.dm +++ b/code/modules/recycling/conveyor2.dm @@ -14,8 +14,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. speed_process = TRUE @@ -57,7 +55,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 == "id") @@ -131,24 +129,36 @@ GLOBAL_LIST_EMPTY(conveyors_by_id) return use_power(6) //get the first 30 items in contents - affecting = list() - var/i = 0 - for(var/item in loc.contents) - if(item == src) - continue - 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