Skip to content

Commit

Permalink
fix(things): fixes assorted runtimes, bad destroys, yadda yadda
Browse files Browse the repository at this point in the history
  • Loading branch information
TobyThorne authored Nov 16, 2023
1 parent d2c36d2 commit 7315e51
Show file tree
Hide file tree
Showing 16 changed files with 146 additions and 81 deletions.
2 changes: 1 addition & 1 deletion code/datums/events/space_dust.dm
Original file line number Diff line number Diff line change
Expand Up @@ -107,6 +107,6 @@
for(var/turf/T in starters)
for(var/i = 1 to rocks_per_tile)
var/obj/item/projectile/bullet/rock/R = new(T)
R.launch(targloc, null, startloc.x - T.x, startloc.y - T.y)
R.launch(targloc)

set_next_think(world.time + (2 SECONDS))
15 changes: 10 additions & 5 deletions code/game/machinery/cryopod.dm
Original file line number Diff line number Diff line change
Expand Up @@ -380,16 +380,21 @@
return
despawning_now = TRUE
//Drop all items into the pod.
for(var/obj/item/I in occupant)
occupant.drop(I, src)
if(I.contents.len) //Make sure we catch anything not handled by qdel() on the items.
for(var/obj/item/I in occupant.contents)
if(QDELETED(I))
continue
if(I in occupant.contents) // Since things may actually be dropped upon removing other things (i.e. removing uniform first causes belts to drop)
occupant.drop(I, src)
else
I.forceMove(src)
if(length(I.contents)) // Make sure we catch anything not handled by qdel() on the items.
for(var/obj/item/O in I.contents)
if(istype(O, /obj/item/storage/internal)) //Stop eating pockets, you fuck!
if(istype(O, /obj/item/storage/internal)) // Stop eating pockets, you fuck!
continue
O.forceMove(src)

//Delete all items not on the preservation list.
var/list/items = src.contents.Copy()
var/list/items = contents.Copy()
items -= occupant // Don't delete the occupant
items -= announce // or the autosay radio.

Expand Down
1 change: 1 addition & 0 deletions code/game/machinery/doors/airlock.dm
Original file line number Diff line number Diff line change
Expand Up @@ -877,6 +877,7 @@ About the new airlock wires panel:

electronics = assembly.electronics
electronics.forceMove(src)
assembly.electronics = null

//update the door's access to match the electronics'
secured_wires = electronics.secure
Expand Down
4 changes: 3 additions & 1 deletion code/game/objects/items/devices/radio/radio.dm
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
/obj/item/device/radio
icon = 'icons/obj/radio.dmi'
name = "shortwave radio"
desc = "A radio. Transmits whatever you say in the shortwave bands."
suffix = "\[3\]"
icon_state = "walkietalkie"
item_state = "walkietalkie"
Expand Down Expand Up @@ -766,12 +767,13 @@
subspace_transmission = 1

/obj/item/device/radio/phone
name = "phone"
desc = "Unfortunately, it's not affiliated with bananas."
broadcasting = 0
icon = 'icons/obj/items.dmi'
icon_state = "red_phone"
randpixel = 0
listening = 1
name = "phone"

/obj/item/device/radio/phone/medbay
frequency = MED_I_FREQ
Expand Down
6 changes: 3 additions & 3 deletions code/game/objects/items/stacks/stack.dm
Original file line number Diff line number Diff line change
Expand Up @@ -49,11 +49,11 @@
if(get_dist(src, user) <= 1)
if(!uses_charge)
if(plural_name)
. += "\nThere [amount == 1 ? "is" : "are"] [amount] [amount == 1 ? "[singular_name]" : "[plural_name]"] in the stack."
. += "\nThere [amount == 1 ? "is" : "are"] <b>[amount] [amount == 1 ? "[singular_name]" : "[plural_name]"]</b> in the stack."
else
. += "\nThere [amount == 1 ? "is" : "are"] [amount] [singular_name]\s in the stack."
. += "\nThere [amount == 1 ? "is" : "are"] <b>[amount] [singular_name]\s</b> in the stack."
else
. += "\nThere is enough charge for [get_amount()]."
. += "\nThere is enough charge for <b>[get_amount()]</b>."
if(color)
. += "\nIt's painted."
if (istype(src,/obj/item/stack/tile))
Expand Down
43 changes: 24 additions & 19 deletions code/game/objects/structures/door_assembly.dm
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,13 @@
var/glass = 0 // 0 = glass can be installed. -1 = glass can't be installed. 1 = glass is already installed. Text = mineral plating is installed instead.
var/created_name = null

New()
update_state()
/obj/structure/door_assembly/Initialize()
. = ..()
update_state()

/obj/structure/door_assembly/Destroy()
QDEL_NULL(electronics)
return ..()

/obj/structure/door_assembly/door_assembly_com
base_icon_state = "com"
Expand Down Expand Up @@ -120,24 +125,24 @@
airlock_type = "/multi_tile/glass"
glass = -1 //To prevent bugs in deconstruction process.

New()
if(dir in list(EAST, WEST))
bound_width = width * world.icon_size
bound_height = world.icon_size
else
bound_width = world.icon_size
bound_height = width * world.icon_size
update_state()

Move()
. = ..()
if(dir in list(EAST, WEST))
bound_width = width * world.icon_size
bound_height = world.icon_size
else
bound_width = world.icon_size
bound_height = width * world.icon_size
/obj/structure/door_assembly/multi_tile/Initialize()
. = ..()
if(dir in list(EAST, WEST))
bound_width = width * world.icon_size
bound_height = world.icon_size
else
bound_width = world.icon_size
bound_height = width * world.icon_size
update_state()

/obj/structure/door_assembly/multi_tile/Move()
. = ..()
if(dir in list(EAST, WEST))
bound_width = width * world.icon_size
bound_height = world.icon_size
else
bound_width = world.icon_size
bound_height = width * world.icon_size


/obj/structure/door_assembly/attackby(obj/item/W as obj, mob/user as mob)
Expand Down
17 changes: 9 additions & 8 deletions code/game/objects/structures/stool_bed_chair_nest/bed.dm
Original file line number Diff line number Diff line change
Expand Up @@ -407,14 +407,15 @@
update_icon()

/obj/structure/bed/roller/proc/manual_unbuckle(mob/user)
if(isanimal(user))
return 0
if(!user.Adjacent(buckled_bodybag) || user.incapacitated(INCAPACITATION_ALL) || istype(user, /mob/living/silicon/pai))
return 0
if(buckled_bodybag)
unbuckle()
add_fingerprint(user)
return 1
if(isanimal(user) || istype(user, /mob/living/silicon/pai))
return FALSE
if(user.incapacitated(INCAPACITATION_ALL))
return FALSE
if(buckled_bodybag && !user.Adjacent(buckled_bodybag))
return FALSE
unbuckle()
add_fingerprint(user)
return TRUE

/obj/structure/bed/roller/buckle_mob(mob/living/M)
if(buckled_bodybag)
Expand Down
7 changes: 7 additions & 0 deletions code/modules/clothing/under/accessories/holster.dm
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,13 @@
holster_action = new /datum/action/item_action/holster
holster_action.target = src

/obj/item/clothing/accessory/holster/Destroy()
if(has_suit)
has_suit.verbs -= /obj/item/clothing/accessory/holster/verb/holster_verb
QDEL_NULL(holstered)
QDEL_NULL(holster_action)
return ..()

/obj/item/clothing/accessory/holster/equipped(mob/user)
. = ..()
holster_action.Grant(user)
Expand Down
28 changes: 17 additions & 11 deletions code/modules/mob/grab/grab_object.dm
Original file line number Diff line number Diff line change
Expand Up @@ -200,20 +200,26 @@
return

var/datum/grab/upgrab = current_grab.upgrade(src)
if(upgrab)
current_grab = upgrab
last_upgrade = world.time
adjust_position()
update_icons()
current_grab.enter_as_up(src)
SEND_SIGNAL(assailant, SIGNAL_MOB_GRAB_SET_STATE, assailant, current_grab.state_name, affecting)
if(QDELETED(upgrab))
delete_self()
return

current_grab = upgrab
last_upgrade = world.time
adjust_position()
update_icons()
current_grab.enter_as_up(src)
SEND_SIGNAL(assailant, SIGNAL_MOB_GRAB_SET_STATE, assailant, current_grab.state_name, affecting)

/obj/item/grab/proc/downgrade()
var/datum/grab/downgrab = current_grab.downgrade()
if(downgrab)
current_grab = downgrab
update_icons()
SEND_SIGNAL(assailant, SIGNAL_MOB_GRAB_SET_STATE, assailant, current_grab.state_name, affecting)
if(QDELETED(downgrab))
delete_self()
return

current_grab = downgrab
update_icons()
SEND_SIGNAL(assailant, SIGNAL_MOB_GRAB_SET_STATE, assailant, current_grab.state_name, affecting)

/obj/item/grab/proc/update_icons()
if(!current_grab)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,15 +31,21 @@
actions += new /datum/action/item_action/prism_glasses/change_prism_colour(src)
actions += new /datum/action/item_action/prism_glasses/place_light_prism(src)

/obj/item/clothing/glasses/prism_glasses/Destroy()
QDEL_NULL_LIST(actions)
return ..()

/obj/item/clothing/glasses/prism_glasses/equipped(mob/user)
if(ishuman(user))
var/mob/living/carbon/human/H = user
if(H.get_equipped_item(slot_glasses)==src)
if(H.get_equipped_item(slot_glasses) == src)
for(var/datum/action/action in actions)
action.Grant(H)

/obj/item/clothing/glasses/prism_glasses/dropped()
for(var/datum/action/action in actions)
if(!action.owner)
continue
action.Remove(action.owner)

/obj/structure/light_prism
Expand Down Expand Up @@ -68,7 +74,7 @@

if(ishuman(owner))
var/mob/living/carbon/human/H = owner
if(!istype(H.get_equipped_item(slot_glasses),/obj/item/clothing/glasses/prism_glasses))
if(!istype(H.get_equipped_item(slot_glasses), /obj/item/clothing/glasses/prism_glasses))
return TRUE

return FALSE
Expand Down
34 changes: 23 additions & 11 deletions code/modules/mob/typing_indicator.dm
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,14 @@
set name = ".add_speech_bubble"
set hidden = TRUE

ASSERT(client && src == usr)
_add_speech_bubble(is_sayinput)

/mob/proc/_add_speech_bubble(is_sayinput)
return

/mob/living/_add_speech_bubble(is_sayinput)
if(!client)
return

thinking_silent = should_show_typing_indicator()

Expand All @@ -52,7 +59,7 @@
start_typing()
return

var/text = winget(usr, ":input", "text")
var/text = winget(src, ":input", "text")
if(findtext(text, "Say ", 1, 5))
thinking_IC = TRUE
start_typing()
Expand All @@ -62,20 +69,25 @@
set name = ".remove_speech_bubble"
set hidden = TRUE

ASSERT(client && src == usr)
_remove_speech_bubble()

var/visible = winget(usr, "saywindow", "is-visible")
if(cmptext(visible, "true"))
stop_typing()
return
/mob/proc/_remove_speech_bubble()
return

var/focus = winget(usr, ":input", "focus")
if(cmptext(focus, "false"))
var/text = winget(usr, ":input", "text")
if(findtext(text, "Say ", 1, 5) && length(text) > 5)
/mob/living/_remove_speech_bubble()
if(client)
var/visible = winget(src, "saywindow", "is-visible")
if(cmptext(visible, "true"))
stop_typing()
return

var/focus = winget(src, ":input", "focus")
if(cmptext(focus, "false"))
var/text = winget(src, ":input", "text")
if(findtext(text, "Say ", 1, 5) && length(text) > 5)
stop_typing()
return

remove_all_indicators()

/mob/verb/me_wrapper()
Expand Down
14 changes: 8 additions & 6 deletions code/modules/paperwork/paper.dm
Original file line number Diff line number Diff line change
Expand Up @@ -377,16 +377,18 @@
add_fingerprint(user)
return
var/obj/item/paper_bundle/B = new(loc)
if (name != "paper")
if(name != "paper")
B.SetName(name)
else if (P.name != "paper" && P.name != "photo")
else if(P.name != "paper" && P.name != "photo")
B.SetName(P.name)

user.replace_item(src, B)
user.drop(P, B)
forceMove(B)
if(loc == user)
user.replace_item(src, B)
forceMove(B)
else
user.drop(P, B)

to_chat(user, SPAN_NOTICE("You clip the [P.name] to \the [src.name]."))
to_chat(user, SPAN("notice", "You clip the [P.name] to \the [name]."))

B.pages += src
B.pages += P
Expand Down
2 changes: 1 addition & 1 deletion code/modules/paperwork/photography.dm
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ var/global/photo_count = 0
overlays |= small_img

tiny = image(img)
small_img.SetTransform(scale = 0.5 * scale)
tiny.SetTransform(scale = 0.5 * scale)
tiny.underlays += image('icons/obj/bureaucracy.dmi',"photo")
tiny.pixel_x = -32*(photo_size-1)/2 - 3
tiny.pixel_y = -32*(photo_size-1)/2 + 3
Expand Down
4 changes: 2 additions & 2 deletions code/modules/power/cell.dm
Original file line number Diff line number Diff line change
Expand Up @@ -102,8 +102,8 @@

/obj/item/cell/_examine_text(mob/user)
. = ..()
. += "\nThe label states it's capacity is [maxcharge] Wh"
. += "\nThe charge meter reads [round(CELL_PERCENT(src), 0.1)]%"
. += "\nThe label states it's capacity is <b>[maxcharge] Wh</b>."
. += "\nThe charge meter reads <b>[round(CELL_PERCENT(src), 0.1)]%<b>."

/obj/item/cell/emp_act(severity)
//remove this once emp changes on dev are merged in
Expand Down
Loading

0 comments on commit 7315e51

Please sign in to comment.