Adds CI to forbid some istype(src) checks. (#26980)

* first set of changes

* the last checks

* actually builds

* Update code/modules/surgery/organs/subtypes/standard_organs.dm

Co-authored-by: Luc <89928798+lewcc@users.noreply.github.com>
Signed-off-by: Contrabang <91113370+Contrabang@users.noreply.github.com>

* Update tools/ci/check_grep2.py

Signed-off-by: Contrabang <91113370+Contrabang@users.noreply.github.com>

* 1 fix (cigarettes) and better encapsulation in files

* yeeep

---------

Signed-off-by: Contrabang <91113370+Contrabang@users.noreply.github.com>
Co-authored-by: Luc <89928798+lewcc@users.noreply.github.com>
This commit is contained in:
Contrabang
2024-11-06 12:56:36 +00:00
committed by GitHub
co-authored by Luc
parent 5ac9a04796
commit 0f717d660a
33 changed files with 178 additions and 149 deletions
@@ -769,13 +769,13 @@
///Checked in life.dm. 0 & 1 = no impairment, 2 = welding mask overlay, 3 = You can see jack, but you can't see shit.
/mob/living/carbon/human/tintcheck()
var/tinted = 0
if(istype(src.head, /obj/item/clothing/head))
if(istype(head, /obj/item/clothing/head))
var/obj/item/clothing/head/HT = src.head
tinted += HT.tint
if(istype(src.glasses, /obj/item/clothing/glasses))
if(istype(glasses, /obj/item/clothing/glasses))
var/obj/item/clothing/glasses/GT = src.glasses
tinted += GT.tint
if(istype(src.wear_mask, /obj/item/clothing/mask))
if(istype(wear_mask, /obj/item/clothing/mask))
var/obj/item/clothing/mask/MT = src.wear_mask
tinted += MT.tint
+1 -2
View File
@@ -391,8 +391,7 @@
temperature -= change
if(actual < desired)
temperature = desired
// if(istype(src, /mob/living/carbon/human))
// to_chat(world, "[src] ~ [bodytemperature] ~ [temperature]")
return temperature
@@ -252,7 +252,7 @@
if(!istype(T, /obj/item/stack/tile/plasteel))
..()
return
if(!istype(src, /obj/item/storage/toolbox))
if(QDELETED(src))
return
if(length(contents) >= 1)
to_chat(user, "<span class='warning'>They won't fit in, as there is already stuff inside.</span>")
+3 -7
View File
@@ -505,7 +505,7 @@ GLOBAL_LIST_INIT(slot_equipment_priority, list( \
if(!disable_warning)
to_chat(usr, "The [name] is too big to attach.")
return 0
if(istype(src, /obj/item/pda) || is_pen(src) || is_type_in_list(src, H.wear_suit.allowed))
if(is_pda(src) || is_pen(src) || is_type_in_list(src, H.wear_suit.allowed))
if(H.s_store)
if(!(H.s_store.flags & NODROP))
return 2
@@ -517,15 +517,11 @@ GLOBAL_LIST_INIT(slot_equipment_priority, list( \
if(SLOT_HUD_HANDCUFFED)
if(H.handcuffed)
return 0
if(!istype(src, /obj/item/restraints/handcuffs))
return 0
return 1
return istype(src, /obj/item/restraints/handcuffs)
if(SLOT_HUD_LEGCUFFED)
if(H.legcuffed)
return 0
if(!istype(src, /obj/item/restraints/legcuffs))
return 0
return 1
return istype(src, /obj/item/restraints/legcuffs)
if(SLOT_HUD_IN_BACKPACK)
if(H.back && istype(H.back, /obj/item/storage/backpack))
var/obj/item/storage/backpack/B = H.back