Some spawn removals and other assorted code cleanup

This commit is contained in:
SteelSlayer
2020-08-07 08:55:34 -05:00
parent 12c031760a
commit d928635393
23 changed files with 92 additions and 150 deletions
+1 -13
View File
@@ -137,19 +137,7 @@
T.ex_act(3)
CHECK_TICK
//--- THROW ITEMS AROUND ---
/*
if(throw_dist > 0)
var/throw_dir = get_dir(epicenter,T)
for(var/obj/item/I in T)
spawn(0) //Simultaneously not one at a time
if(I && !I.anchored)
var/throw_mult = 0.5 + (0.5 * rand()) // Between 0.5 and 1.0
var/throw_range = round((throw_dist + 1) * throw_mult) // Roughly 50% to 100% of throw_dist
if(throw_range > 0)
var/turf/throw_at = get_ranged_target_turf(I, throw_dir, throw_range)
I.throw_at(throw_at, throw_range, 2, no_spin = 1) //Throw it at 2 speed, this is purely visual anyway; don't spin the thrown items, it's very costly.
*/
var/took = stop_watch(watch)
//You need to press the DebugGame verb to see these now....they were getting annoying and we've collected a fair bit of data. Just -test- changes to explosion code using this please so we can compare
if(GLOB.debug2)
+5 -8
View File
@@ -56,16 +56,13 @@
/obj/structure/closet/body_bag/MouseDrop(over_object, src_location, over_location)
..()
. = ..()
if((over_object == usr && (in_range(src, usr) || usr.contents.Find(src))))
if(!ishuman(usr)) return
if(opened) return 0
if(contents.len) return 0
visible_message("[usr] folds up the [src.name]")
if(!ishuman(usr) || opened || length(contents))
return FALSE
visible_message("[usr] folds up the [name]")
new item_path(get_turf(src))
spawn(0)
qdel(src)
return
qdel(src)
/obj/structure/closet/body_bag/relaymove(mob/user as mob)
if(user.stat)
+7 -10
View File
@@ -42,26 +42,23 @@
create_reagents(5)
/obj/item/kitchen/utensil/attack(mob/living/carbon/M as mob, mob/living/carbon/user as mob)
if(!istype(M))
/obj/item/kitchen/utensil/attack(mob/living/carbon/C, mob/living/carbon/user)
if(!istype(C))
return ..()
if(user.a_intent != INTENT_HELP)
if(user.zone_selected == "head" || user.zone_selected == "eyes")
if((CLUMSY in user.mutations) && prob(50))
M = user
return eyestab(M,user)
C = user
return eyestab(C, user)
else
return ..()
if(contents.len)
if(length(contents))
var/obj/item/reagent_containers/food/snacks/toEat = contents[1]
if(istype(toEat))
if(M.eat(toEat, user))
toEat.On_Consume(M, user)
spawn(0)
if(toEat)
qdel(toEat)
if(C.eat(toEat, user))
toEat.On_Consume(C, user)
overlays.Cut()
return