mirror of
https://github.com/Aurorastation/Aurora.3.git
synced 2026-08-29 16:10:02 +01:00
Code Cleanup: Destroy() fixes part 1 + Misc Fixes (#1933)
In this PR: Destroy() fixes backported from PR #1783. JaniPDA fixes & improvements. Chickens no longer consume their own eggs. Language adding in setup is now 100% more sane. Chemical dispensers now actually check that the user is still alive before renaming. Ghosts are now marked as non-simulated atoms. Non-simulated atoms no longer trigger proximity listeners. Vendors no longer accept synthetic tools as stocking options. Fixes #812. Fixes #1877, Fixes #1929. Fixes #1930. Fixes #1152, Fixes #1917. Fixes #1902. Fixes #1165.
This commit is contained in:
@@ -116,7 +116,7 @@
|
||||
|
||||
/obj/item/weapon/cartridge/signal/Destroy()
|
||||
qdel(radio)
|
||||
..()
|
||||
return ..()
|
||||
|
||||
/obj/item/weapon/cartridge/quartermaster
|
||||
name = "\improper Space Parts & Space Vendors cartridge"
|
||||
@@ -436,7 +436,7 @@
|
||||
else
|
||||
JaniData["user_loc"] = list("x" = 0, "y" = 0)
|
||||
var/MopData[0]
|
||||
for(var/obj/item/weapon/mop/M in world)
|
||||
for(var/obj/item/weapon/mop/M in global.janitorial_supplies)
|
||||
var/turf/ml = get_turf(M)
|
||||
if(ml)
|
||||
if(ml.z != cl.z)
|
||||
@@ -447,9 +447,8 @@
|
||||
if(!MopData.len)
|
||||
MopData[++MopData.len] = list("x" = 0, "y" = 0, dir=null, status = null)
|
||||
|
||||
|
||||
var/BucketData[0]
|
||||
for(var/obj/structure/mopbucket/B in world)
|
||||
for(var/obj/structure/mopbucket/B in global.janitorial_supplies)
|
||||
var/turf/bl = get_turf(B)
|
||||
if(bl)
|
||||
if(bl.z != cl.z)
|
||||
@@ -461,7 +460,7 @@
|
||||
BucketData[++BucketData.len] = list("x" = 0, "y" = 0, dir=null, status = null)
|
||||
|
||||
var/CbotData[0]
|
||||
for(var/mob/living/bot/cleanbot/B in world)
|
||||
for(var/mob/living/bot/cleanbot/B in global.janitorial_supplies)
|
||||
var/turf/bl = get_turf(B)
|
||||
if(bl)
|
||||
if(bl.z != cl.z)
|
||||
@@ -469,23 +468,19 @@
|
||||
var/direction = get_dir(src,B)
|
||||
CbotData[++CbotData.len] = list("x" = bl.x, "y" = bl.y, "dir" = uppertext(dir2text(direction)), "status" = B.on ? "Online" : "Offline")
|
||||
|
||||
|
||||
if(!CbotData.len)
|
||||
CbotData[++CbotData.len] = list("x" = 0, "y" = 0, dir=null, status = null)
|
||||
var/CartData[0]
|
||||
for(var/obj/structure/janitorialcart/B in world)
|
||||
for(var/obj/structure/janitorialcart/B in global.janitorial_supplies)
|
||||
var/turf/bl = get_turf(B)
|
||||
if(bl)
|
||||
if(bl.z != cl.z)
|
||||
continue
|
||||
var/direction = get_dir(src,B)
|
||||
CartData[++CartData.len] = list("x" = bl.x, "y" = bl.y, "dir" = uppertext(dir2text(direction)), "status" = B.reagents.total_volume/100)
|
||||
CartData[++CartData.len] = list("x" = bl.x, "y" = bl.y, "dir" = uppertext(dir2text(direction)), "status" = B.get_short_status())
|
||||
if(!CartData.len)
|
||||
CartData[++CartData.len] = list("x" = 0, "y" = 0, dir=null, status = null)
|
||||
|
||||
|
||||
|
||||
|
||||
JaniData["mops"] = MopData
|
||||
JaniData["buckets"] = BucketData
|
||||
JaniData["cleanbots"] = CbotData
|
||||
@@ -495,9 +490,6 @@
|
||||
return values
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
/obj/item/weapon/cartridge/Topic(href, href_list)
|
||||
..()
|
||||
|
||||
|
||||
@@ -120,6 +120,10 @@ var/const/NO_EMAG_ACT = -50
|
||||
var/rank = null //actual job
|
||||
var/dorm = 0 // determines if this ID has claimed a dorm already
|
||||
|
||||
/obj/item/weapon/card/id/Destroy()
|
||||
mob = null
|
||||
return ..()
|
||||
|
||||
/obj/item/weapon/card/id/examine(mob/user)
|
||||
set src in oview(1)
|
||||
if(in_range(usr, src))
|
||||
|
||||
@@ -106,6 +106,7 @@
|
||||
|
||||
var/obj/item/weapon/material/twohanded/offhand/O = user.get_inactive_hand()
|
||||
if(O && istype(O))
|
||||
user.u_equip(O)
|
||||
O.unwield()
|
||||
|
||||
else //Trying to wield it
|
||||
@@ -137,9 +138,17 @@
|
||||
default_material = "placeholder"
|
||||
|
||||
/obj/item/weapon/material/twohanded/offhand/unwield()
|
||||
if (ismob(loc))
|
||||
var/mob/living/our_mob = loc
|
||||
our_mob.remove_from_mob(src)
|
||||
|
||||
qdel(src)
|
||||
|
||||
/obj/item/weapon/material/twohanded/offhand/wield()
|
||||
if (ismob(loc))
|
||||
var/mob/living/our_mob = loc
|
||||
our_mob.remove_from_mob(src)
|
||||
|
||||
qdel(src)
|
||||
|
||||
/obj/item/weapon/material/twohanded/offhand/update_icon()
|
||||
|
||||
@@ -18,6 +18,10 @@
|
||||
spark_system = bind_spark(src, 5)
|
||||
..()
|
||||
|
||||
/obj/item/weapon/melee/energy/Destroy()
|
||||
QDEL_NULL(spark_system)
|
||||
return ..()
|
||||
|
||||
/obj/item/weapon/melee/energy/proc/activate(mob/living/user)
|
||||
anchored = 1
|
||||
if(active)
|
||||
|
||||
@@ -12,9 +12,14 @@
|
||||
var/mopping = 0
|
||||
var/mopcount = 0
|
||||
|
||||
|
||||
/obj/item/weapon/mop/New()
|
||||
..()
|
||||
create_reagents(30)
|
||||
janitorial_supplies |= src
|
||||
|
||||
/obj/item/weapon/mop/Destroy()
|
||||
janitorial_supplies -= src
|
||||
return ..()
|
||||
|
||||
/obj/item/weapon/mop/afterattack(atom/A, mob/user, proximity)
|
||||
if(!proximity) return
|
||||
|
||||
@@ -22,8 +22,21 @@
|
||||
var/has_items = 0//This is set true whenever the cart has anything loaded/mounted on it
|
||||
var/dismantled = 0//This is set true after the object has been dismantled to avoid an infintie loop
|
||||
|
||||
///obj/structure/janitorialcart/New()
|
||||
/obj/structure/janitorialcart/New()
|
||||
..()
|
||||
janitorial_supplies |= src
|
||||
|
||||
/obj/structure/janitorialcart/Destroy()
|
||||
janitorial_supplies -= src
|
||||
QDEL_NULL(mybag)
|
||||
QDEL_NULL(mymop)
|
||||
QDEL_NULL(myspray)
|
||||
QDEL_NULL(myreplacer)
|
||||
QDEL_NULL(mybucket)
|
||||
return ..()
|
||||
|
||||
/obj/structure/janitorialcart/proc/get_short_status()
|
||||
return "Contents: [english_list(contents)]"
|
||||
|
||||
/obj/structure/janitorialcart/examine(mob/user)
|
||||
if(..(user, 1))
|
||||
|
||||
@@ -10,12 +10,17 @@
|
||||
|
||||
|
||||
/obj/structure/mopbucket/New()
|
||||
create_reagents(100)
|
||||
..()
|
||||
create_reagents(100)
|
||||
janitorial_supplies |= src
|
||||
|
||||
/obj/structure/mobbucket/Destroy()
|
||||
janitorial_supplies -= src
|
||||
return ..()
|
||||
|
||||
/obj/structure/mopbucket/examine(mob/user)
|
||||
if(..(user, 1))
|
||||
user << "[src] \icon[src] contains [reagents.total_volume] unit\s of water!"
|
||||
user << "Contains [reagents.total_volume] unit\s of water."
|
||||
|
||||
/obj/structure/mopbucket/attackby(obj/item/I, mob/user)
|
||||
if(istype(I, /obj/item/weapon/mop))
|
||||
|
||||
@@ -35,7 +35,7 @@
|
||||
/obj/effect/wingrille_spawn/proc/activate()
|
||||
if(activated) return
|
||||
if (!locate(/obj/structure/grille) in get_turf(src))
|
||||
var/obj/structure/grille/G = getFromPool(/obj/structure/grille, src.loc)
|
||||
var/obj/structure/grille/G = new /obj/structure/grille(src.loc)
|
||||
handle_grille_spawn(G)
|
||||
var/list/neighbours = list()
|
||||
for (var/dir in cardinal)
|
||||
@@ -49,7 +49,7 @@
|
||||
found_connection = 1
|
||||
qdel(W)
|
||||
if(!found_connection)
|
||||
var/obj/structure/window/new_win = getFromPool(win_path, src.loc)
|
||||
var/obj/structure/window/new_win = new win_path(src.loc)
|
||||
new_win.set_dir(dir)
|
||||
handle_window_spawn(new_win)
|
||||
else
|
||||
|
||||
Reference in New Issue
Block a user