Fixes runtimes when you talk with a cig butt in your mouth (#28250)

* Minor fixes

* Oops

* Funnyman review
This commit is contained in:
DGamerL
2025-02-05 21:26:20 +00:00
committed by GitHub
parent fdc37eae63
commit 1c4a5180ed
9 changed files with 35 additions and 23 deletions
+2
View File
@@ -62,6 +62,8 @@
#define isclothing(A) (istype(A, /obj/item/clothing))
#define ismask(A) (istype(A, /obj/item/clothing/mask))
#define isprojectile(A) (istype(A, /obj/item/projectile))
#define isgun(A) (istype(A, /obj/item/gun))
-3
View File
@@ -276,9 +276,6 @@
#define is_ai_eye(A) (istype((A), /mob/camera/eye))
#define isovermind(A) (istype((A), /mob/camera/blob))
#define isSpirit(A) (istype((A), /mob/spirit))
#define ismask(A) (istype((A), /mob/spirit/mask))
#define isobserver(A) (istype((A), /mob/dead/observer))
#define isnewplayer(A) (istype((A), /mob/new_player))
+2 -1
View File
@@ -1607,7 +1607,8 @@
H.update_fhair()
H.update_dna()
H.wear_mask.adjustmask(H) // push it back on the head
var/obj/item/clothing/mask/worn_mask = H.wear_mask
worn_mask.adjustmask(H) // push it back on the head
equip_item(H, /obj/item/clothing/mask/cigarette/cigar, ITEM_SLOT_MASK) // get them their cigar
if(istype(H.glasses, /obj/item/clothing/glasses)) // this is gonna be always true
var/obj/item/clothing/glasses/glassass = H.glasses
+16 -8
View File
@@ -384,14 +384,22 @@
. = ..()
if(!.)
return
var/can_eat = TRUE
if(iscarbon(user))
var/mob/living/carbon/C = user
if((C.head && (C.head.flags_cover & HEADCOVERSMOUTH)) || (C.wear_mask && (C.wear_mask.flags_cover & MASKCOVERSMOUTH) && !C.wear_mask.up))
if(show_message)
to_chat(C, "<span class='warning'>Your mouth is covered, preventing you from eating!</span>")
can_eat = FALSE
return can_eat
if(!iscarbon(user))
return TRUE
var/mob/living/carbon/C = user
if(!(C.head?.flags_cover & HEADCOVERSMOUTH))
if(!ismask(C.wear_mask))
return TRUE
var/obj/item/clothing/mask/worn_mask = C.wear_mask
if(!(worn_mask.flags_cover & MASKCOVERSMOUTH) || worn_mask.up)
return TRUE
if(show_message)
to_chat(C, "<span class='warning'>Your mouth is covered, preventing you from eating!</span>")
return FALSE
/datum/spell/eat/proc/doHeal(mob/user)
if(ishuman(user))
+4
View File
@@ -1017,3 +1017,7 @@ GLOBAL_DATUM_INIT(welding_sparks, /mutable_appearance, mutable_appearance('icons
return FALSE
return cig
/// Changes the speech verb when wearing this item if a value is returned
/obj/item/proc/change_speech_verb()
return
-4
View File
@@ -613,10 +613,6 @@
var/datum/action/A = X
A.UpdateButtons()
// Changes the speech verb when wearing a mask if a value is returned
/obj/item/clothing/mask/proc/change_speech_verb()
return
//////////////////////////////
// MARK: SHOES
//////////////////////////////
@@ -1253,8 +1253,9 @@ so that different stomachs can handle things in different ways VB*/
if(istype(head, /obj/item/clothing/head))
var/obj/item/clothing/head/HT = head
. += HT.tint
if(istype(wear_mask))
. += wear_mask.tint
if(ismask(wear_mask))
var/obj/item/clothing/mask/worn_mask = wear_mask
. += worn_mask.tint
var/obj/item/organ/internal/eyes/E = get_organ_slot("eyes")
if(E)
@@ -90,9 +90,11 @@
to_chat(user, "<span class='warning'>Your throat hurts too much to do it right now. Wait [round((cooldown - world.time) / 10)] seconds and try again.</span>")
return
if(!welding_fuel_used || user.reagents.has_reagent("fuel", welding_fuel_used))
if((user.head?.flags_cover & HEADCOVERSMOUTH) || (user.wear_mask?.flags_cover & MASKCOVERSMOUTH) && !user.wear_mask?.up)
to_chat(user, "<span class='warning'>Your mouth is covered.</span>")
return
if(ismask(user.wear_mask))
var/obj/item/clothing/mask/worn_mask = user.wear_mask
if((user.head?.flags_cover & HEADCOVERSMOUTH) || (worn_mask.flags_cover & MASKCOVERSMOUTH) && !worn_mask.up)
to_chat(user, "<span class='warning'>Your mouth is covered.</span>")
return
var/obj/item/match/unathi/fire = new(user.loc, src)
if(user.put_in_hands(fire))
to_chat(user, "<span class='notice'>You ignite a small flame in your mouth.</span>")
+3 -2
View File
@@ -80,8 +80,9 @@
var/obj/item/back = null //Human
var/obj/item/tank/internal = null //Human
/// Active storage container
var/obj/item/storage/s_active = null //Carbon
var/obj/item/clothing/mask/wear_mask = null //Carbon
var/obj/item/storage/s_active
/// The currently worn mask
var/obj/item/wear_mask
/// The instantiated version of the mob's hud.
var/datum/hud/hud_used = null