diff --git a/code/__DEFINES/flags.dm b/code/__DEFINES/flags.dm index 0ef81b5fc3c..dd01389520b 100644 --- a/code/__DEFINES/flags.dm +++ b/code/__DEFINES/flags.dm @@ -19,7 +19,7 @@ #define FPRINT 256 // takes a fingerprint #define ON_BORDER 512 // item has priority to check when entering or leaving #define HOLOGRAM 32768 // HOlodeck shit should not be used in any fucking things - +#define DROPDEL 1024 // When dropped, it calls qdel on itself #define HEADBANGPROTECT 4096 #define EARBANGPROTECT 1024 diff --git a/code/_onclick/telekinesis.dm b/code/_onclick/telekinesis.dm index c2e7f630f5f..9c783dc19ef 100644 --- a/code/_onclick/telekinesis.dm +++ b/code/_onclick/telekinesis.dm @@ -68,7 +68,7 @@ var/const/tk_maxrange = 15 desc = "Magic" icon = 'icons/obj/magic.dmi'//Needs sprites icon_state = "2" - flags = NOBLUDGEON | ABSTRACT + flags = NOBLUDGEON | ABSTRACT | DROPDEL //item_state = null w_class = 10 layer = ABOVE_HUD_LAYER @@ -82,10 +82,7 @@ var/const/tk_maxrange = 15 if(focus && user && loc != user && loc != user.loc) // drop_item() gets called when you tk-attack a table/closet with an item if(focus.Adjacent(loc)) focus.loc = loc - - qdel(src) - return - + . = ..() //stops TK grabs being equipped anywhere but into hands /obj/item/tk_grab/equipped(mob/user, slot) diff --git a/code/game/gamemodes/changeling/powers/mutations.dm b/code/game/gamemodes/changeling/powers/mutations.dm index e0b264238fe..54177c07e8a 100644 --- a/code/game/gamemodes/changeling/powers/mutations.dm +++ b/code/game/gamemodes/changeling/powers/mutations.dm @@ -150,7 +150,7 @@ icon = 'icons/obj/weapons.dmi' icon_state = "arm_blade" item_state = "arm_blade" - flags = ABSTRACT | NODROP + flags = ABSTRACT | NODROP | DROPDEL w_class = 5.0 force = 25 throwforce = 0 //Just to be on the safe side @@ -163,9 +163,6 @@ if(ismob(loc) && !silent) loc.visible_message("A grotesque blade forms around [loc.name]\'s arm!", "Our arm twists and mutates, transforming it into a deadly blade.", "You hear organic matter ripping and tearing!") -/obj/item/weapon/melee/arm_blade/dropped(mob/user) - qdel(src) - /obj/item/weapon/melee/arm_blade/afterattack(atom/target, mob/user, proximity) if(!proximity) return @@ -230,7 +227,7 @@ /obj/item/weapon/shield/changeling name = "shield-like mass" desc = "A mass of tough, boney tissue. You can still see the fingers as a twisted pattern in the shield." - flags = ABSTRACT | NODROP + flags = ABSTRACT | NODROP | DROPDEL icon = 'icons/obj/weapons.dmi' icon_state = "ling_shield" block_chance = 50 @@ -242,9 +239,6 @@ if(ismob(loc)) loc.visible_message("The end of [loc.name]\'s hand inflates rapidly, forming a huge shield-like mass!", "We inflate our hand into a strong shield.", "You hear organic matter ripping and tearing!") -/obj/item/clothing/head/helmet/space/changeling/dropped() - qdel(src) - /obj/item/weapon/shield/changeling/hit_reaction() if(remaining_uses < 1) if(ishuman(loc)) @@ -282,7 +276,7 @@ name = "flesh mass" icon_state = "lingspacesuit" desc = "A huge, bulky mass of pressure and temperature-resistant organic tissue, evolved to facilitate space travel." - flags = STOPSPRESSUREDMAGE | NODROP //Not THICKMATERIAL because it's organic tissue, so if somebody tries to inject something into it, it still ends up in your blood. (also balance but muh fluff) + flags = STOPSPRESSUREDMAGE | NODROP | DROPDEL //Not THICKMATERIAL because it's organic tissue, so if somebody tries to inject something into it, it still ends up in your blood. (also balance but muh fluff) allowed = list(/obj/item/device/flashlight, /obj/item/weapon/tank/internals/emergency_oxygen, /obj/item/weapon/tank/internals/oxygen) armor = list(melee = 0, bullet = 0, laser = 0,energy = 0, bomb = 0, bio = 0, rad = 0) //No armor at all. @@ -292,9 +286,6 @@ loc.visible_message("[loc.name]\'s flesh rapidly inflates, forming a bloated mass around their body!", "We inflate our flesh, creating a spaceproof suit!", "You hear organic matter ripping and tearing!") SSobj.processing += src -/obj/item/clothing/suit/space/changeling/dropped() - qdel(src) - /obj/item/clothing/suit/space/changeling/process() if(ishuman(loc)) var/mob/living/carbon/human/H = loc @@ -304,14 +295,10 @@ name = "flesh mass" icon_state = "lingspacehelmet" desc = "A covering of pressure and temperature-resistant organic tissue with a glass-like chitin front." - flags = STOPSPRESSUREDMAGE | NODROP //Again, no THICKMATERIAL. + flags = STOPSPRESSUREDMAGE | NODROP | DROPDEL //Again, no THICKMATERIAL. armor = list(melee = 0, bullet = 0, laser = 0,energy = 0, bomb = 0, bio = 0, rad = 0) flags_cover = HEADCOVERSEYES | HEADCOVERSMOUTH -/obj/item/clothing/head/helmet/space/changeling/dropped() - qdel(src) - - /***************************************\ |*****************ARMOR*****************| \***************************************/ @@ -335,7 +322,7 @@ name = "chitinous mass" desc = "A tough, hard covering of black chitin." icon_state = "lingarmor" - flags = NODROP + flags = NODROP | DROPDEL body_parts_covered = CHEST|GROIN|LEGS|FEET|ARMS|HANDS armor = list(melee = 40, bullet = 40, laser = 40, energy = 20, bomb = 10, bio = 4, rad = 0) flags_inv = HIDEJUMPSUIT @@ -347,16 +334,10 @@ if(ismob(loc)) loc.visible_message("[loc.name]\'s flesh turns black, quickly transforming into a hard, chitinous mass!", "We harden our flesh, creating a suit of armor!", "You hear organic matter ripping and tearing!") -/obj/item/clothing/suit/armor/changeling/dropped() - qdel(src) - /obj/item/clothing/head/helmet/changeling name = "chitinous mass" desc = "A tough, hard covering of black chitin with transparent chitin in front." icon_state = "lingarmorhelmet" - flags = NODROP + flags = NODROP | DROPDEL armor = list(melee = 30, bullet = 30, laser = 40, energy = 20, bomb = 10, bio = 4, rad = 0) flags_inv = HIDEEARS|HIDEHAIR|HIDEEYES|HIDEFACIALHAIR|HIDEFACE - -/obj/item/clothing/head/helmet/changeling/dropped() - qdel(src) diff --git a/code/game/gamemodes/cult/talisman.dm b/code/game/gamemodes/cult/talisman.dm index 35f625f3a61..8962fb95af0 100644 --- a/code/game/gamemodes/cult/talisman.dm +++ b/code/game/gamemodes/cult/talisman.dm @@ -408,8 +408,9 @@ desc = "Shackles that bind the wrists with sinister magic." trashtype = /obj/item/weapon/restraints/handcuffs/energy/used origin_tech = "materials=2;magnets=5" + flags = DROPDEL /obj/item/weapon/restraints/handcuffs/energy/cult/used/dropped(mob/user) user.visible_message("[user]'s shackles shatter in a discharge of dark magic!", \ "Your [src] shatters in a discharge of dark magic!") - qdel(src) + . = ..() diff --git a/code/game/gamemodes/miniantags/abduction/abduction_gear.dm b/code/game/gamemodes/miniantags/abduction/abduction_gear.dm index 6456b1a1d61..46eaa891a32 100644 --- a/code/game/gamemodes/miniantags/abduction/abduction_gear.dm +++ b/code/game/gamemodes/miniantags/abduction/abduction_gear.dm @@ -511,6 +511,7 @@ Congratulations! You are now trained for xenobiology research!"} /obj/item/weapon/restraints/handcuffs/energy/used desc = "energy discharge" + flags = DROPDEL /obj/item/weapon/restraints/handcuffs/energy/used/dropped(mob/user) user.visible_message("[user]'s [src] break in a discharge of energy!", \ @@ -518,7 +519,7 @@ Congratulations! You are now trained for xenobiology research!"} var/datum/effect_system/spark_spread/S = new S.set_up(4,0,user.loc) S.start() - qdel(src) + . = ..() /obj/item/weapon/abductor_baton/examine(mob/user) ..() diff --git a/code/game/objects/items.dm b/code/game/objects/items.dm index c1380146069..b0560f90c96 100644 --- a/code/game/objects/items.dm +++ b/code/game/objects/items.dm @@ -358,6 +358,8 @@ var/global/image/fire_overlay = image("icon" = 'icons/effects/fire.dmi', "icon_s for(var/X in actions) var/datum/action/A = X A.Remove(user) + if(DROPDEL & flags) + qdel(src) // called just as an item is picked up (loc is not yet changed) /obj/item/proc/pickup(mob/user) diff --git a/code/game/objects/items/weapons/chrono_eraser.dm b/code/game/objects/items/weapons/chrono_eraser.dm index 71542183b71..49ce1244925 100644 --- a/code/game/objects/items/weapons/chrono_eraser.dm +++ b/code/game/objects/items/weapons/chrono_eraser.dm @@ -46,7 +46,7 @@ icon_state = "chronogun" item_state = "chronogun" w_class = 3 - flags = NODROP + flags = NODROP | DROPDEL ammo_type = list(/obj/item/ammo_casing/energy/chrono_beam) can_charge = 0 fire_delay = 50 @@ -62,10 +62,6 @@ TED = new(src.loc) qdel(src) -/obj/item/weapon/gun/energy/chrono_gun/dropped() - ..() - qdel(src) - /obj/item/weapon/gun/energy/chrono_gun/update_icon() return @@ -264,4 +260,4 @@ #undef CHRONO_BEAM_RANGE -#undef CHRONO_FRAME_COUNT \ No newline at end of file +#undef CHRONO_FRAME_COUNT diff --git a/code/game/objects/items/weapons/handcuffs.dm b/code/game/objects/items/weapons/handcuffs.dm index 75c498c13b6..759d46e9af4 100644 --- a/code/game/objects/items/weapons/handcuffs.dm +++ b/code/game/objects/items/weapons/handcuffs.dm @@ -290,19 +290,18 @@ armed = 1 icon_state = "e_snare" trap_damage = 0 + flags = DROPDEL /obj/item/weapon/restraints/legcuffs/beartrap/energy/New() ..() - spawn(100) - if(!istype(loc, /mob)) - var/datum/effect_system/spark_spread/sparks = new /datum/effect_system/spark_spread - sparks.set_up(1, 1, src) - sparks.start() - qdel(src) + addtimer(src, "dissipate", 100) -/obj/item/weapon/restraints/legcuffs/beartrap/energy/dropped() - ..() - qdel(src) +/obj/item/weapon/restraints/legcuffs/beartrap/energy/proc/dissipate() + if(!istype(loc, /mob)) + var/datum/effect_system/spark_spread/sparks = new /datum/effect_system/spark_spread + sparks.set_up(1, 1, src) + sparks.start() + qdel(src) /obj/item/weapon/restraints/legcuffs/beartrap/energy/attack_hand(mob/user) Crossed(user) //honk diff --git a/code/game/objects/items/weapons/holy_weapons.dm b/code/game/objects/items/weapons/holy_weapons.dm index bc43d5a1cd8..1d2b8e8a571 100644 --- a/code/game/objects/items/weapons/holy_weapons.dm +++ b/code/game/objects/items/weapons/holy_weapons.dm @@ -49,15 +49,12 @@ item_state = "disintegrate" name = "god hand" desc = "This hand of yours glows with an awesome power!" - flags = ABSTRACT | NODROP + flags = ABSTRACT | NODROP | DROPDEL w_class = 5 hitsound = 'sound/weapons/sear.ogg' damtype = BURN attack_verb = list("punched", "cross countered", "pummeled") -/obj/item/weapon/nullrod/godhand/dropped(mob/user) - qdel(src) - /obj/item/weapon/nullrod/staff icon_state = "godstaff-red" item_state = "godstaff-red" diff --git a/code/game/objects/items/weapons/implants/implant.dm b/code/game/objects/items/weapons/implants/implant.dm index 644228e9515..1aab163493e 100644 --- a/code/game/objects/items/weapons/implants/implant.dm +++ b/code/game/objects/items/weapons/implants/implant.dm @@ -10,6 +10,7 @@ item_color = "b" var/allow_multiple = 0 var/uses = -1 + flags = DROPDEL /obj/item/weapon/implant/proc/trigger(emote, mob/source) @@ -73,12 +74,9 @@ removed(imp_in) return ..() - /obj/item/weapon/implant/proc/get_data() return "No information available" /obj/item/weapon/implant/dropped(mob/user) ..() . = 1 - qdel(src) - diff --git a/code/modules/projectiles/guns/projectile/laser_gatling.dm b/code/modules/projectiles/guns/projectile/laser_gatling.dm index 9633418413a..d8ec700580c 100644 --- a/code/modules/projectiles/guns/projectile/laser_gatling.dm +++ b/code/modules/projectiles/guns/projectile/laser_gatling.dm @@ -147,7 +147,6 @@ /obj/item/weapon/gun/projectile/minigun/dropped(mob/living/user) ammo_pack.attach_gun(user) - return /obj/item/weapon/gun/projectile/minigun/process_chamber(eject_casing = 0, empty_chamber = 1) ..() diff --git a/code/modules/zombie/items.dm b/code/modules/zombie/items.dm index b3805c1c509..9057dff9547 100644 --- a/code/modules/zombie/items.dm +++ b/code/modules/zombie/items.dm @@ -4,7 +4,7 @@ unconcious or dead humans, butchering all other living things to \ sustain the zombie, forcing open airlock doors and opening \ child-safe caps on bottles." - flags = NODROP|ABSTRACT + flags = NODROP|ABSTRACT|DROPDEL icon = 'icons/effects/blood.dmi' icon_state = "bloodhand_left" var/icon_left = "bloodhand_left" @@ -24,11 +24,6 @@ if(slot_r_hand) icon_state = icon_left -/obj/item/zombie_hand/dropped(mob/user) - . = ..() - // Zombie hands are force dropped upon species loss - qdel(src) - /obj/item/zombie_hand/afterattack(atom/target, mob/user, proximity_flag) . = ..() if(!proximity_flag)