Various runtimes (#7873)

This commit is contained in:
Raeschen
2024-03-03 17:49:29 +01:00
committed by GitHub
parent 35b15c2406
commit 9866adc9b3
10 changed files with 116 additions and 66 deletions

View File

@@ -78,12 +78,11 @@ var/list/runechat_image_cache = list()
if(timer_delete) if(timer_delete)
deltimer(timer_delete) deltimer(timer_delete)
timer_delete = null timer_delete = null
if(!QDELETED(owned_by)) if(istype(owned_by, /client)) // hopefully the PARENT_QDELETING on client should beat this if it's a disconnect
UnregisterSignal(owned_by, COMSIG_PARENT_QDELETING) UnregisterSignal(owned_by, COMSIG_PARENT_QDELETING)
if(owned_by.seen_messages)
LAZYREMOVEASSOC(owned_by.seen_messages, message_loc, src) LAZYREMOVEASSOC(owned_by.seen_messages, message_loc, src)
owned_by.images.Remove(message) owned_by.images.Remove(message)
if(!QDELETED(message_loc))
UnregisterSignal(message_loc, COMSIG_PARENT_QDELETING)
owned_by = null owned_by = null
message_loc = null message_loc = null
message = null message = null
@@ -108,7 +107,7 @@ var/list/runechat_image_cache = list()
// Register client who owns this message // Register client who owns this message
owned_by = owner.client owned_by = owner.client
RegisterSignal(owned_by, COMSIG_PARENT_QDELETING, PROC_REF(qdel_self)) RegisterSignal(owned_by, COMSIG_PARENT_QDELETING, PROC_REF(unregister_qdel_self)) // this should only call owned_by if the client is destroyed
var/extra_length = owned_by.is_preference_enabled(/datum/client_preference/runechat_long_messages) var/extra_length = owned_by.is_preference_enabled(/datum/client_preference/runechat_long_messages)
var/maxlen = extra_length ? CHAT_MESSAGE_EXT_LENGTH : CHAT_MESSAGE_LENGTH var/maxlen = extra_length ? CHAT_MESSAGE_EXT_LENGTH : CHAT_MESSAGE_LENGTH
@@ -217,6 +216,10 @@ var/list/runechat_image_cache = list()
spawn(lifespan - CHAT_MESSAGE_EOL_FADE) spawn(lifespan - CHAT_MESSAGE_EOL_FADE)
end_of_life() end_of_life()
/datum/chatmessage/proc/unregister_qdel_self() // this should only call owned_by if the client is destroyed
UnregisterSignal(owned_by, COMSIG_PARENT_QDELETING)
owned_by = null
qdel_self()
/** /**
* Applies final animations to overlay CHAT_MESSAGE_EOL_FADE deciseconds prior to message deletion * Applies final animations to overlay CHAT_MESSAGE_EOL_FADE deciseconds prior to message deletion
*/ */

View File

@@ -424,6 +424,7 @@
for(var/obj/item/W in items) for(var/obj/item/W in items)
if(islist(W.possessed_voice)) //CHOMPAdd if(islist(W.possessed_voice)) //CHOMPAdd
W.forceMove(get_turf(src)) //CHOMPAdd - this crashes the MC, so now they get spat back out. W.forceMove(get_turf(src)) //CHOMPAdd - this crashes the MC, so now they get spat back out.
items -= W
continue //CHOMPAdd continue //CHOMPAdd
//VOREStation Addition Start //VOREStation Addition Start
if(istype(W, /obj/item/device/pda)) if(istype(W, /obj/item/device/pda))
@@ -477,6 +478,9 @@
SStranscore.leave_round(to_despawn) SStranscore.leave_round(to_despawn)
//VOREStation Edit End - Resleeving. //VOREStation Edit End - Resleeving.
// Everything below should only be applicable to a cliented living/carbon/human.
// All living/carbon/humans should have minds.
//Handle job slot/tater cleanup. //Handle job slot/tater cleanup.
var/job = to_despawn.mind.assigned_role var/job = to_despawn.mind.assigned_role
job_master.FreeRole(job) job_master.FreeRole(job)

View File

@@ -26,7 +26,7 @@
if(message) if(message)
audible_message("[icon2html(src, user.client)] \The [src.name] states, \"[message]\"", runemessage = "synthesized speech") audible_message("[icon2html(src, user.client)] \The [src.name] states, \"[message]\"", runemessage = "synthesized speech")
if(ismob(loc)) if(ismob(loc))
loc.audible_message("", runemessage = "\[TTS Voice\] [message]") loc.runechat_message("\[TTS Voice\] [message]")
/obj/item/device/text_to_speech/AltClick(mob/user) // QOL Change /obj/item/device/text_to_speech/AltClick(mob/user) // QOL Change
attack_self(user) attack_self(user)

View File

@@ -273,6 +273,18 @@
//DISCONNECT// //DISCONNECT//
////////////// //////////////
/client/Del() /client/Del()
if(!gc_destroyed)
gc_destroyed = world.time
if (!QDELING(src))
stack_trace("Client does not purport to be QDELING, this is going to cause bugs in other places!")
// Yes this is the same as what's found in qdel(). Yes it does need to be here
// Get off my back
SEND_SIGNAL(src, COMSIG_PARENT_QDELETING, TRUE)
Destroy() //Clean up signals and timers.
return ..()
/client/Destroy()
if(holder) if(holder)
holder.owner = null holder.owner = null
GLOB.admins -= src GLOB.admins -= src
@@ -282,9 +294,7 @@
GLOB.tickets.ClientLogout(src) // CHOMPedit - Tickets System GLOB.tickets.ClientLogout(src) // CHOMPedit - Tickets System
GLOB.directory -= ckey GLOB.directory -= ckey
GLOB.clients -= src GLOB.clients -= src
return ..()
/client/Destroy()
..() ..()
return QDEL_HINT_HARDDEL_NOW return QDEL_HINT_HARDDEL_NOW

View File

@@ -451,7 +451,7 @@ var/global/list/valid_bloodtypes = list("A+", "A-", "B+", "B-", "AB+", "AB-", "O
for(var/BP in mark_datum.body_parts) for(var/BP in mark_datum.body_parts)
var/obj/item/organ/external/O = character.organs_by_name[BP] var/obj/item/organ/external/O = character.organs_by_name[BP]
if(O) if(O && islist(O.markings) && islist(pref.body_markings[M]))
O.markings[M] = list("color" = pref.body_markings[M][BP]["color"], "datum" = mark_datum, "priority" = priority, "on" = pref.body_markings[M][BP]["on"]) O.markings[M] = list("color" = pref.body_markings[M][BP]["color"], "datum" = mark_datum, "priority" = priority, "on" = pref.body_markings[M][BP]["on"])
character.markings_len = priority character.markings_len = priority

View File

@@ -122,6 +122,8 @@ I think I covered everything.
var/small_icon = 'icons/mob/bigdragon_small.dmi' var/small_icon = 'icons/mob/bigdragon_small.dmi'
var/small_icon_state = "dragon_small" var/small_icon_state = "dragon_small"
var/flames var/flames
var/firebreathtimer
var/chargetimer
tame_items = list( tame_items = list(
/obj/item/weapon/coin/gold = 100, /obj/item/weapon/coin/gold = 100,
@@ -262,6 +264,10 @@ I think I covered everything.
/mob/living/simple_mob/vore/bigdragon/runechat_y_offset(width, height) /mob/living/simple_mob/vore/bigdragon/runechat_y_offset(width, height)
return (..()*size_multiplier) + 40 return (..()*size_multiplier) + 40
/mob/living/simple_mob/vore/bigdragon/death()
. = ..()
canceltimers()
/// ///
/// Verbs /// Verbs
/// ///
@@ -776,10 +782,14 @@ I think I covered everything.
do_windup_animation(A, charge_warmup) do_windup_animation(A, charge_warmup)
//callbacks are more reliable than byond's process scheduler //callbacks are more reliable than byond's process scheduler
addtimer(CALLBACK(src, PROC_REF(chargeend), A), charge_warmup) chargetimer = addtimer(CALLBACK(src, PROC_REF(chargeend), A), charge_warmup, TIMER_STOPPABLE)
/mob/living/simple_mob/vore/bigdragon/proc/chargeend(var/atom/A, var/explicit = 0, var/gentle = 0) /mob/living/simple_mob/vore/bigdragon/proc/chargeend(var/atom/A, var/explicit = 0, var/gentle = 0)
//make sure our target still exists and is on a turf
if(QDELETED(A) || !isturf(get_turf(A)))
set_AI_busy(FALSE)
return
status_flags |= LEAPING status_flags |= LEAPING
flying = 1 //So we can thunk into things flying = 1 //So we can thunk into things
hovering = 1 // So we don't hurt ourselves running off cliffs hovering = 1 // So we don't hurt ourselves running off cliffs
@@ -814,10 +824,14 @@ I think I covered everything.
set_AI_busy(TRUE) set_AI_busy(TRUE)
flames = 1 flames = 1
build_icons() build_icons()
addtimer(CALLBACK(src, PROC_REF(firebreathend), A), charge_warmup) firebreathtimer = addtimer(CALLBACK(src, PROC_REF(firebreathend), A), charge_warmup, TIMER_STOPPABLE)
playsound(src, "sound/magic/Fireball.ogg", 50, 1) playsound(src, "sound/magic/Fireball.ogg", 50, 1)
/mob/living/simple_mob/vore/bigdragon/proc/firebreathend(var/atom/A) /mob/living/simple_mob/vore/bigdragon/proc/firebreathend(var/atom/A)
//make sure our target still exists and is on a turf
if(QDELETED(A) || !isturf(get_turf(A)))
set_AI_busy(FALSE)
return
var/obj/item/projectile/P = new /obj/item/projectile/bullet/dragon(get_turf(src)) var/obj/item/projectile/P = new /obj/item/projectile/bullet/dragon(get_turf(src))
src.visible_message("<span class='danger'>\The [src] spews fire at \the [A]!</span>") src.visible_message("<span class='danger'>\The [src] spews fire at \the [A]!</span>")
playsound(src, "sound/weapons/Flamer.ogg", 50, 1) playsound(src, "sound/weapons/Flamer.ogg", 50, 1)
@@ -901,6 +915,9 @@ I think I covered everything.
vore_selected = gut2 //Just incase it eats someone right after being tamed vore_selected = gut2 //Just incase it eats someone right after being tamed
ai_holder = new /datum/ai_holder/simple_mob/healbelly/retaliate/dragon(src) ai_holder = new /datum/ai_holder/simple_mob/healbelly/retaliate/dragon(src)
//Cancel any charges or firebreaths winding up
canceltimers()
/datum/ai_holder/simple_mob/healbelly /datum/ai_holder/simple_mob/healbelly
intelligence_level = 3 intelligence_level = 3
can_breakthrough = 0 can_breakthrough = 0
@@ -1043,6 +1060,17 @@ I think I covered everything.
vore_selected = gut1 vore_selected = gut1
D.give_target(attacker) D.give_target(attacker)
/mob/living/simple_mob/vore/bigdragon/proc/canceltimers()
//Cancel any charges or firebreaths winding up
if(firebreathtimer)
deltimer(firebreathtimer)
firebreathtimer = null
if(chargetimer)
deltimer(chargetimer)
chargetimer = null
//re-enable the AI
set_AI_busy(FALSE)
//Smack people it warns //Smack people it warns
/datum/ai_holder/simple_mob/healbelly/retaliate/dragon/proc/dissuade(var/chump) /datum/ai_holder/simple_mob/healbelly/retaliate/dragon/proc/dissuade(var/chump)
if(chump in check_trajectory(chump, holder, pass_flags = PASSTABLE)) if(chump in check_trajectory(chump, holder, pass_flags = PASSTABLE))

View File

@@ -23,7 +23,7 @@
previewing_belly = null // from code/modules/vore/eating/mob_ch.dm previewing_belly = null // from code/modules/vore/eating/mob_ch.dm
vore_selected = null // from code/modules/vore/eating/mob_vr vore_selected = null // from code/modules/vore/eating/mob_vr
focus = null
if(mind) if(mind)
if(mind.current == src) if(mind.current == src)
@@ -1224,19 +1224,22 @@
return 0 return 0
//Exploitable Info Update //Exploitable Info Update
/obj
var/datum/weakref/exploit_for //if this obj is an exploit for somebody, this points to them
/mob/proc/amend_exploitable(var/obj/item/I) /mob/proc/amend_exploitable(var/obj/item/I)
if(istype(I)) if(istype(I))
exploit_addons |= I exploit_addons |= I
var/exploitmsg = html_decode("\n" + "Has " + I.name + ".") var/exploitmsg = html_decode("\n" + "Has " + I.name + ".")
exploit_record += exploitmsg exploit_record += exploitmsg
I.exploit_for = WEAKREF(src)
/obj/Destroy() /obj/Destroy()
if(istype(src.loc, /mob)) if(exploit_for)
var/mob/holder = src.loc var/mob/exploited = exploit_for.resolve()
if(src in holder.exploit_addons) exploited?.exploit_addons -= src
holder.exploit_addons -= src exploit_for = null
. = ..() . = ..()

View File

@@ -439,7 +439,7 @@
/datum/reagent/acid/touch_obj(var/obj/O, var/amount) //CHOMPEdit Start /datum/reagent/acid/touch_obj(var/obj/O, var/amount) //CHOMPEdit Start
if(istype(O, /obj/item) && O.loc) if(istype(O, /obj/item) && O.loc)
if(isbelly(O.loc) || isbelly(O.loc.loc)) if(isbelly(O.loc) || isbelly(O.loc.loc))
var/obj/belly/B = O.loc var/obj/belly/B = (isbelly(O.loc) ? O.loc : O.loc.loc)
if(B.item_digest_mode == IM_HOLD) if(B.item_digest_mode == IM_HOLD)
return return
var/obj/item/I = O var/obj/item/I = O

View File

@@ -89,7 +89,7 @@
* return bool - TRUE if a new pooled window is opened, FALSE in all other situations including if a new pooled window didn't open because one already exists. * return bool - TRUE if a new pooled window is opened, FALSE in all other situations including if a new pooled window didn't open because one already exists.
*/ */
/datum/tgui/proc/open() /datum/tgui/proc/open()
if(!user.client) if(!user?.client)
return FALSE return FALSE
if(window) if(window)
return FALSE return FALSE
@@ -214,7 +214,7 @@
* optional force bool Send an update even if UI is not interactive. * optional force bool Send an update even if UI is not interactive.
*/ */
/datum/tgui/proc/send_full_update(custom_data, force) /datum/tgui/proc/send_full_update(custom_data, force)
if(!user.client || !initialized || closing) if(!user?.client || !initialized || closing)
return return
//if(!COOLDOWN_FINISHED(src, refresh_cooldown)) //if(!COOLDOWN_FINISHED(src, refresh_cooldown))
//refreshing = TRUE //refreshing = TRUE

View File

@@ -596,6 +596,8 @@
// Called whenever an atom leaves this belly // Called whenever an atom leaves this belly
/obj/belly/Exited(atom/movable/thing, atom/OldLoc) /obj/belly/Exited(atom/movable/thing, atom/OldLoc)
. = ..() . = ..()
if(QDELETED(owner))
return
thing.exit_belly(src) // CHOMPEdit - atom movable proc, does nothing by default. Overridden in children for special behavior. thing.exit_belly(src) // CHOMPEdit - atom movable proc, does nothing by default. Overridden in children for special behavior.
if(isbelly(thing.loc)) //CHOMPEdit Start if(isbelly(thing.loc)) //CHOMPEdit Start
var/obj/belly/NB = thing.loc var/obj/belly/NB = thing.loc