From 27a7f754c4e4bc902afb5de030cb37d0004d614f Mon Sep 17 00:00:00 2001
From: Ghommie <42542238+Ghommie@users.noreply.github.com>
Date: Tue, 10 Mar 2020 22:40:06 +0100
Subject: [PATCH] Fix runtimes some more.
---
code/datums/components/riding.dm | 2 +-
code/datums/elements/mob_holder.dm | 2 +-
code/game/machinery/pipe/construction.dm | 4 ++--
code/game/objects/items/chrono_eraser.dm | 6 +-----
code/game/objects/items/devices/chameleonproj.dm | 2 +-
code/game/objects/items/devices/geiger_counter.dm | 2 +-
code/game/objects/items/devices/scanners.dm | 4 ++--
code/game/objects/items/devices/transfer_valve.dm | 4 ++--
code/game/objects/items/granters.dm | 4 ++--
code/game/objects/items/robot/robot_items.dm | 4 ++--
code/game/objects/items/storage/bags.dm | 2 +-
code/game/objects/objs.dm | 9 ++++-----
code/modules/assembly/bomb.dm | 4 ++--
code/modules/assembly/holder.dm | 4 ++--
code/modules/assembly/infrared.dm | 2 +-
code/modules/awaymissions/capture_the_flag.dm | 8 ++++----
code/modules/clothing/head/soft_caps.dm | 8 ++++----
code/modules/clothing/spacesuits/chronosuit.dm | 13 ++-----------
code/modules/clothing/spacesuits/flightsuit.dm | 5 +++--
code/modules/clothing/spacesuits/hardsuit.dm | 2 +-
code/modules/clothing/suits/toggles.dm | 6 +++---
code/modules/fields/fields.dm | 2 +-
code/modules/hydroponics/grown/banana.dm | 2 +-
code/modules/mob/living/carbon/inventory.dm | 4 ++--
.../modules/projectiles/guns/ballistic/automatic.dm | 1 -
code/modules/projectiles/guns/ballistic/shotgun.dm | 2 +-
.../projectiles/guns/energy/kinetic_accelerator.dm | 4 ++--
27 files changed, 49 insertions(+), 63 deletions(-)
diff --git a/code/datums/components/riding.dm b/code/datums/components/riding.dm
index 750120976f..e7f25a7724 100644
--- a/code/datums/components/riding.dm
+++ b/code/datums/components/riding.dm
@@ -341,7 +341,7 @@
var/mob/living/parent
var/selfdeleting = FALSE
-/obj/item/riding_offhand/dropped()
+/obj/item/riding_offhand/dropped(mob/user)
selfdeleting = TRUE
. = ..()
diff --git a/code/datums/elements/mob_holder.dm b/code/datums/elements/mob_holder.dm
index 06ff0c1386..18fa60a508 100644
--- a/code/datums/elements/mob_holder.dm
+++ b/code/datums/elements/mob_holder.dm
@@ -138,7 +138,7 @@
destination = get_turf(loc)
AM.forceMove(destination)
-/obj/item/clothing/head/mob_holder/dropped()
+/obj/item/clothing/head/mob_holder/dropped(mob/user)
. = ..()
if(held_mob && isturf(loc))//don't release on soft-drops
release()
diff --git a/code/game/machinery/pipe/construction.dm b/code/game/machinery/pipe/construction.dm
index 8b6c2180d9..97c89c9168 100644
--- a/code/game/machinery/pipe/construction.dm
+++ b/code/game/machinery/pipe/construction.dm
@@ -63,7 +63,7 @@ Buildable meters
if(make_from.flipped)
do_a_flip()
-/obj/item/pipe/dropped()
+/obj/item/pipe/dropped(mob/user)
if(loc)
setPipingLayer(piping_layer)
return ..()
@@ -225,7 +225,7 @@ Buildable meters
to_chat(user, "You fasten the meter to the [loc.name].")
qdel(src)
-/obj/item/pipe_meter/dropped()
+/obj/item/pipe_meter/dropped(mob/user)
. = ..()
if(loc)
setAttachLayer(piping_layer)
diff --git a/code/game/objects/items/chrono_eraser.dm b/code/game/objects/items/chrono_eraser.dm
index 7b8c53484a..6b3428698b 100644
--- a/code/game/objects/items/chrono_eraser.dm
+++ b/code/game/objects/items/chrono_eraser.dm
@@ -18,15 +18,11 @@
/obj/item/chrono_eraser/proc/pass_mind(datum/mind/M)
erased_minds += M
-/obj/item/chrono_eraser/dropped()
+/obj/item/chrono_eraser/dropped(mob/user)
..()
if(PA)
qdel(PA)
-/obj/item/chrono_eraser/Destroy()
- dropped()
- return ..()
-
/obj/item/chrono_eraser/ui_action_click(mob/user)
if(iscarbon(user))
var/mob/living/carbon/C = user
diff --git a/code/game/objects/items/devices/chameleonproj.dm b/code/game/objects/items/devices/chameleonproj.dm
index e87987600a..57443de973 100644
--- a/code/game/objects/items/devices/chameleonproj.dm
+++ b/code/game/objects/items/devices/chameleonproj.dm
@@ -21,7 +21,7 @@
var/obj/item/cigbutt/butt = /obj/item/cigbutt
saved_appearance = initial(butt.appearance)
-/obj/item/chameleon/dropped()
+/obj/item/chameleon/dropped(mob/user)
..()
disrupt()
diff --git a/code/game/objects/items/devices/geiger_counter.dm b/code/game/objects/items/devices/geiger_counter.dm
index 9eb51ffaeb..5cab9e33de 100644
--- a/code/game/objects/items/devices/geiger_counter.dm
+++ b/code/game/objects/items/devices/geiger_counter.dm
@@ -218,7 +218,7 @@
/obj/item/geiger_counter/cyborg/proc/redirect_rad_act(datum/source, amount)
rad_act(amount)
-/obj/item/geiger_counter/cyborg/dropped()
+/obj/item/geiger_counter/cyborg/dropped(mob/user)
. = ..()
if(listeningTo)
UnregisterSignal(listeningTo, COMSIG_ATOM_RAD_ACT)
diff --git a/code/game/objects/items/devices/scanners.dm b/code/game/objects/items/devices/scanners.dm
index 556080168f..41d4e7050b 100644
--- a/code/game/objects/items/devices/scanners.dm
+++ b/code/game/objects/items/devices/scanners.dm
@@ -326,8 +326,8 @@ SLIME SCANNER
breathes = FALSE
if(NOBLOOD in C.dna.species.species_traits)
blooded = FALSE
- var/has_liver = (!(NOLIVER in C.dna.species.species_traits))
- var/has_stomach = (!(NOSTOMACH in C.dna.species.species_traits))
+ var/has_liver = C.dna && !(NOLIVER in C.dna.species.species_traits)
+ var/has_stomach = C.dna && !(NOSTOMACH in C.dna.species.species_traits)
if(!M.getorganslot(ORGAN_SLOT_EYES))
msg += "\tSubject does not have eyes.\n"
if(!M.getorganslot(ORGAN_SLOT_EARS))
diff --git a/code/game/objects/items/devices/transfer_valve.dm b/code/game/objects/items/devices/transfer_valve.dm
index 2c101b0ec5..b929642f33 100644
--- a/code/game/objects/items/devices/transfer_valve.dm
+++ b/code/game/objects/items/devices/transfer_valve.dm
@@ -63,10 +63,10 @@
if(attached_device)
attached_device.holder_movement()
-/obj/item/transfer_valve/dropped()
+/obj/item/transfer_valve/dropped(mob/user)
. = ..()
if(attached_device)
- attached_device.dropped()
+ attached_device.dropped(user)
/obj/item/transfer_valve/on_found(mob/finder)
if(attached_device)
diff --git a/code/game/objects/items/granters.dm b/code/game/objects/items/granters.dm
index 0907a18fdd..827e6f4249 100644
--- a/code/game/objects/items/granters.dm
+++ b/code/game/objects/items/granters.dm
@@ -11,7 +11,7 @@
/obj/item/book/granter/proc/turn_page(mob/user)
playsound(user, pick('sound/effects/pageturn1.ogg','sound/effects/pageturn2.ogg','sound/effects/pageturn3.ogg'), 30, 1)
- if(do_after(user,50, user))
+ if(do_after(user,50, TRUE, user))
if(remarks.len)
to_chat(user, "[pick(remarks)]")
else
@@ -53,7 +53,7 @@
on_reading_stopped()
reading = FALSE
return
- if(do_after(user,50, user))
+ if(do_after(user,50, TRUE, user))
on_reading_finished(user)
reading = FALSE
return TRUE
diff --git a/code/game/objects/items/robot/robot_items.dm b/code/game/objects/items/robot/robot_items.dm
index d3e966f2fa..0e573dcff1 100644
--- a/code/game/objects/items/robot/robot_items.dm
+++ b/code/game/objects/items/robot/robot_items.dm
@@ -357,7 +357,7 @@
/obj/item/borg/lollipop/equipped()
check_amount()
-/obj/item/borg/lollipop/dropped()
+/obj/item/borg/lollipop/dropped(mob/user)
check_amount()
/obj/item/borg/lollipop/proc/check_amount() //Doesn't even use processing ticks.
@@ -620,7 +620,7 @@
return host.loc
return null
-/obj/item/borg/projectile_dampen/dropped()
+/obj/item/borg/projectile_dampen/dropped(mob/user)
. = ..()
host = loc
diff --git a/code/game/objects/items/storage/bags.dm b/code/game/objects/items/storage/bags.dm
index 7a6e1e3db6..103dabdeec 100644
--- a/code/game/objects/items/storage/bags.dm
+++ b/code/game/objects/items/storage/bags.dm
@@ -132,7 +132,7 @@
RegisterSignal(user, COMSIG_MOVABLE_MOVED, .proc/Pickup_ores)
listeningTo = user
-/obj/item/storage/bag/ore/dropped()
+/obj/item/storage/bag/ore/dropped(mob/user)
. = ..()
if(listeningTo)
UnregisterSignal(listeningTo, COMSIG_MOVABLE_MOVED)
diff --git a/code/game/objects/objs.dm b/code/game/objects/objs.dm
index 3fc183edc6..c92bbdc996 100644
--- a/code/game/objects/objs.dm
+++ b/code/game/objects/objs.dm
@@ -127,11 +127,10 @@
if ((M.client && M.machine == src))
is_in_use = TRUE
ui_interact(M)
- if(isAI(usr) || iscyborg(usr) || IsAdminGhost(usr) || hasSiliconAccessInArea(usr))
- if (!(usr in nearby))
- if (usr.client && usr.machine==src) // && M.machine == src is omitted because if we triggered this by using the dialog, it doesn't matter if our machine changed in between triggering it and this - the dialog is probably still supposed to refresh.
- is_in_use = TRUE
- ui_interact(usr)
+ if(usr && hasSiliconAccessInArea(usr) && !(usr in nearby))
+ if (usr.client && usr.machine==src) // && M.machine == src is omitted because if we triggered this by using the dialog, it doesn't matter if our machine changed in between triggering it and this - the dialog is probably still supposed to refresh.
+ is_in_use = TRUE
+ ui_interact(usr)
// check for TK users
diff --git a/code/modules/assembly/bomb.dm b/code/modules/assembly/bomb.dm
index 28bb543828..8eb6db8693 100644
--- a/code/modules/assembly/bomb.dm
+++ b/code/modules/assembly/bomb.dm
@@ -101,10 +101,10 @@
bombassembly.setDir(dir)
bombassembly.Move()
-/obj/item/onetankbomb/dropped()
+/obj/item/onetankbomb/dropped(mob/user)
. = ..()
if(bombassembly)
- bombassembly.dropped()
+ bombassembly.dropped(user)
diff --git a/code/modules/assembly/holder.dm b/code/modules/assembly/holder.dm
index d7c184de92..c960a7f039 100644
--- a/code/modules/assembly/holder.dm
+++ b/code/modules/assembly/holder.dm
@@ -83,9 +83,9 @@
/obj/item/assembly_holder/dropped(mob/user)
. = ..()
if(a_left)
- a_left.dropped()
+ a_left.dropped(user)
if(a_right)
- a_right.dropped()
+ a_right.dropped(user)
/obj/item/assembly_holder/attack_hand()//Perhapse this should be a holder_pickup proc instead, can add if needbe I guess
. = ..()
diff --git a/code/modules/assembly/infrared.dm b/code/modules/assembly/infrared.dm
index d19666077d..be13df2070 100644
--- a/code/modules/assembly/infrared.dm
+++ b/code/modules/assembly/infrared.dm
@@ -74,7 +74,7 @@
holder.update_icon()
return
-/obj/item/assembly/infra/dropped()
+/obj/item/assembly/infra/dropped(mob/user)
. = ..()
if(holder)
holder_movement() //sync the dir of the device as well if it's contained in a TTV or an assembly holder
diff --git a/code/modules/awaymissions/capture_the_flag.dm b/code/modules/awaymissions/capture_the_flag.dm
index c4bb6e8cdd..594eae5d46 100644
--- a/code/modules/awaymissions/capture_the_flag.dm
+++ b/code/modules/awaymissions/capture_the_flag.dm
@@ -379,7 +379,7 @@
force = 75
mag_type = /obj/item/ammo_box/magazine/m50/ctf
-/obj/item/gun/ballistic/automatic/pistol/deagle/ctf/dropped()
+/obj/item/gun/ballistic/automatic/pistol/deagle/ctf/dropped(mob/user)
. = ..()
addtimer(CALLBACK(GLOBAL_PROC, /proc/ctf_floor_vanish, src), 1)
@@ -402,14 +402,14 @@
desc = "This looks like it could really hurt in melee."
force = 50
-/obj/item/gun/ballistic/automatic/laser/ctf/dropped()
+/obj/item/gun/ballistic/automatic/laser/ctf/dropped(mob/user)
. = ..()
addtimer(CALLBACK(GLOBAL_PROC, /proc/ctf_floor_vanish, src), 1)
/obj/item/ammo_box/magazine/recharge/ctf
ammo_type = /obj/item/ammo_casing/caseless/laser/ctf
-/obj/item/ammo_box/magazine/recharge/ctf/dropped()
+/obj/item/ammo_box/magazine/recharge/ctf/dropped(mob/user)
. = ..()
addtimer(CALLBACK(GLOBAL_PROC, /proc/ctf_floor_vanish, src), 1)
@@ -475,7 +475,7 @@
return TRUE
return ..()
-/obj/item/claymore/ctf/dropped()
+/obj/item/claymore/ctf/dropped(mob/user)
. = ..()
addtimer(CALLBACK(GLOBAL_PROC, /proc/ctf_floor_vanish, src), 1)
diff --git a/code/modules/clothing/head/soft_caps.dm b/code/modules/clothing/head/soft_caps.dm
index cb169f4f62..19ff6bc8b2 100644
--- a/code/modules/clothing/head/soft_caps.dm
+++ b/code/modules/clothing/head/soft_caps.dm
@@ -9,10 +9,10 @@
var/flipped = 0
-/obj/item/clothing/head/soft/dropped()
- src.icon_state = "[item_color]soft"
- src.flipped=0
- ..()
+/obj/item/clothing/head/soft/dropped(mob/user)
+ icon_state = "[item_color]soft"
+ flipped = FALSE
+ return ..()
/obj/item/clothing/head/soft/verb/flipcap()
set category = "Object"
diff --git a/code/modules/clothing/spacesuits/chronosuit.dm b/code/modules/clothing/spacesuits/chronosuit.dm
index 3d06fba285..347381b8f8 100644
--- a/code/modules/clothing/spacesuits/chronosuit.dm
+++ b/code/modules/clothing/spacesuits/chronosuit.dm
@@ -8,16 +8,11 @@
resistance_flags = FIRE_PROOF | ACID_PROOF
var/obj/item/clothing/suit/space/chronos/suit = null
-/obj/item/clothing/head/helmet/space/chronos/dropped()
+/obj/item/clothing/head/helmet/space/chronos/dropped(mob/user)
if(suit)
suit.deactivate(1, 1)
..()
-/obj/item/clothing/head/helmet/space/chronos/Destroy()
- dropped()
- return ..()
-
-
/obj/item/clothing/suit/space/chronos
name = "Chronosuit"
desc = "An advanced spacesuit equipped with time-bluespace teleportation and anti-compression technology."
@@ -57,15 +52,11 @@
else
deactivate()
-/obj/item/clothing/suit/space/chronos/dropped()
+/obj/item/clothing/suit/space/chronos/dropped(mob/user)
if(activated)
deactivate()
..()
-/obj/item/clothing/suit/space/chronos/Destroy()
- dropped()
- return ..()
-
/obj/item/clothing/suit/space/chronos/emp_act(severity)
. = ..()
if(. & EMP_PROTECT_SELF)
diff --git a/code/modules/clothing/spacesuits/flightsuit.dm b/code/modules/clothing/spacesuits/flightsuit.dm
index 2f9ded7848..89644667d0 100644
--- a/code/modules/clothing/spacesuits/flightsuit.dm
+++ b/code/modules/clothing/spacesuits/flightsuit.dm
@@ -805,7 +805,8 @@
. += "Its maintainence panel is [maint_panel ? "OPEN" : "CLOSED"]"
/obj/item/clothing/suit/space/hardsuit/flightsuit/Destroy()
- dropped()
+ if(ismob(loc))
+ dropped(loc)
QDEL_NULL(pack)
QDEL_NULL(shoes)
return ..()
@@ -834,7 +835,7 @@
return FALSE
return ..()
-/obj/item/clothing/suit/space/hardsuit/flightsuit/dropped()
+/obj/item/clothing/suit/space/hardsuit/flightsuit/dropped(mob/the_user)
if(deployedpack)
retract_flightpack(TRUE)
if(deployedshoes)
diff --git a/code/modules/clothing/spacesuits/hardsuit.dm b/code/modules/clothing/spacesuits/hardsuit.dm
index d9e4f17649..48dfbd1624 100644
--- a/code/modules/clothing/spacesuits/hardsuit.dm
+++ b/code/modules/clothing/spacesuits/hardsuit.dm
@@ -705,7 +705,7 @@
RegisterSignal(user, COMSIG_MOVABLE_MOVED, .proc/on_mob_move)
listeningTo = user
-/obj/item/clothing/suit/space/hardsuit/ancient/dropped()
+/obj/item/clothing/suit/space/hardsuit/ancient/dropped(mob/user)
. = ..()
if(listeningTo)
UnregisterSignal(listeningTo, COMSIG_MOVABLE_MOVED)
diff --git a/code/modules/clothing/suits/toggles.dm b/code/modules/clothing/suits/toggles.dm
index 79b221a807..cbbd64ebcc 100644
--- a/code/modules/clothing/suits/toggles.dm
+++ b/code/modules/clothing/suits/toggles.dm
@@ -45,7 +45,7 @@
var/datum/action/A = X
A.UpdateButtonIcon()
-/obj/item/clothing/suit/hooded/dropped()
+/obj/item/clothing/suit/hooded/dropped(mob/user)
..()
RemoveHood()
@@ -76,7 +76,7 @@
suit = null
return ..()
-/obj/item/clothing/head/hooded/dropped()
+/obj/item/clothing/head/hooded/dropped(mob/user)
..()
if(suit)
suit.RemoveHood()
@@ -174,7 +174,7 @@
else
helmet.forceMove(src)
-/obj/item/clothing/suit/space/hardsuit/dropped()
+/obj/item/clothing/suit/space/hardsuit/dropped(mob/user)
..()
RemoveHelmet()
diff --git a/code/modules/fields/fields.dm b/code/modules/fields/fields.dm
index 5b0b4bc1f8..8710282021 100644
--- a/code/modules/fields/fields.dm
+++ b/code/modules/fields/fields.dm
@@ -312,7 +312,7 @@
else if(!operating)
QDEL_NULL(current)
-/obj/item/multitool/field_debug/dropped()
+/obj/item/multitool/field_debug/dropped(mob/user)
. = ..()
if(listeningTo)
UnregisterSignal(listeningTo, COMSIG_MOVABLE_MOVED)
diff --git a/code/modules/hydroponics/grown/banana.dm b/code/modules/hydroponics/grown/banana.dm
index 7668d17ac1..09d07b808a 100644
--- a/code/modules/hydroponics/grown/banana.dm
+++ b/code/modules/hydroponics/grown/banana.dm
@@ -151,7 +151,7 @@
spawn(30)
if(!QDELETED(src))
var/mob/living/simple_animal/banana_spider/S = new /mob/living/simple_animal/banana_spider(get_turf(src.loc))
- S.speed += round(10 / seed.potency)
+ S.speed += round(10 - 10 * (seed.potency/100), 1)
S.visible_message("The banana spider chitters as it stretches its legs.")
qdel(src)
diff --git a/code/modules/mob/living/carbon/inventory.dm b/code/modules/mob/living/carbon/inventory.dm
index 24acccdd2e..50801e1c0d 100644
--- a/code/modules/mob/living/carbon/inventory.dm
+++ b/code/modules/mob/living/carbon/inventory.dm
@@ -122,9 +122,9 @@
update_inv_wear_mask()
/mob/living/carbon/wear_mask_update(obj/item/clothing/C, toggle_off = 1)
- if(C.tint || initial(C.tint))
+ if(isclothing(C) && (C.tint || initial(C.tint)))
update_tint()
- update_inv_wear_mask()
+ return ..()
//handle stuff to update when a mob equips/unequips a headgear.
/mob/living/carbon/proc/head_update(obj/item/I, forced)
diff --git a/code/modules/projectiles/guns/ballistic/automatic.dm b/code/modules/projectiles/guns/ballistic/automatic.dm
index 0ff0c79f1e..39428275c8 100644
--- a/code/modules/projectiles/guns/ballistic/automatic.dm
+++ b/code/modules/projectiles/guns/ballistic/automatic.dm
@@ -39,7 +39,6 @@
magazine = AM
if(oldmag)
to_chat(user, "You perform a tactical reload on \the [src], replacing the magazine.")
- oldmag.dropped()
oldmag.forceMove(get_turf(src.loc))
oldmag.update_icon()
else
diff --git a/code/modules/projectiles/guns/ballistic/shotgun.dm b/code/modules/projectiles/guns/ballistic/shotgun.dm
index 571525d8f0..7f01db466f 100644
--- a/code/modules/projectiles/guns/ballistic/shotgun.dm
+++ b/code/modules/projectiles/guns/ballistic/shotgun.dm
@@ -171,7 +171,7 @@
pump()
gun_type = type
-/obj/item/gun/ballistic/shotgun/boltaction/enchanted/dropped()
+/obj/item/gun/ballistic/shotgun/boltaction/enchanted/dropped(mob/user)
..()
guns_left = 0
diff --git a/code/modules/projectiles/guns/energy/kinetic_accelerator.dm b/code/modules/projectiles/guns/energy/kinetic_accelerator.dm
index 6cd567ce16..c5660624a2 100644
--- a/code/modules/projectiles/guns/energy/kinetic_accelerator.dm
+++ b/code/modules/projectiles/guns/energy/kinetic_accelerator.dm
@@ -34,7 +34,7 @@
righthand_file = 'icons/mob/inhands/weapons/guns_righthand.dmi'
ammo_type = list(/obj/item/ammo_casing/energy/kinetic/premium)
-/obj/item/gun/energy/kinetic_accelerator/premiumka/dropped()
+/obj/item/gun/energy/kinetic_accelerator/premiumka/dropped(mob/user)
. = ..()
if(!QDELING(src) && !holds_charge)
// Put it on a delay because moving item from slot to hand
@@ -137,7 +137,7 @@
if(!can_shoot())
attempt_reload()
-/obj/item/gun/energy/kinetic_accelerator/dropped()
+/obj/item/gun/energy/kinetic_accelerator/dropped(mob/user)
. = ..()
if(!QDELING(src) && !holds_charge)
// Put it on a delay because moving item from slot to hand