linters do your magic (#19263)

This commit is contained in:
Vi3trice
2022-10-10 20:58:41 +02:00
committed by GitHub
parent 9e90c81282
commit 20c437f7d2
101 changed files with 153 additions and 153 deletions
@@ -13,7 +13,7 @@ Doesn't work on other aliens/AI.*/
else if(X && getPlasma() < X)
to_chat(src, "<span class='noticealien'>Not enough plasma stored.</span>")
return 0
else if(Y && (!isturf(src.loc) || istype(src.loc, /turf/space)))
else if(Y && (!isturf(src.loc) || isspaceturf(src.loc)))
to_chat(src, "<span class='noticealien'>You can't place that here!</span>")
return 0
else return 1
+2 -2
View File
@@ -249,11 +249,11 @@
// Also neatly handles basically every case where a brain
// is inserted or removed from an MMI
/obj/item/mmi/Entered(atom/movable/A)
if(radio && istype(A, /mob/living/carbon/brain))
if(radio && isbrain(A))
radio_action.Grant(A)
/obj/item/mmi/Exited(atom/movable/A)
if(radio && istype(A, /mob/living/carbon/brain))
if(radio && isbrain(A))
radio_action.Remove(A)
@@ -84,7 +84,7 @@ I'm using this for Stat to give it a more nifty interface to work with
if(client.statpanel == "Status")
//Knowing how well-off your mech is doing is really important as an MMI
if(istype(src.loc, /obj/mecha))
if(ismecha(src.loc))
var/obj/mecha/M = src.loc
stat("Exosuit Charge:", "[istype(M.cell) ? "[M.cell.charge] / [M.cell.maxcharge]" : "No cell detected"]")
stat("Exosuit Integrity", "[!M.obj_integrity ? "0" : "[(M.obj_integrity / M.max_integrity) * 100]"]%")
+1 -1
View File
@@ -1228,7 +1228,7 @@ so that different stomachs can handle things in different ways VB*/
//handle stuff to update when a mob equips/unequips a headgear.
/mob/living/carbon/proc/head_update(obj/item/I, forced)
if(istype(I, /obj/item/clothing))
if(isclothing(I))
var/obj/item/clothing/C = I
if(C.tint || initial(C.tint))
update_tint()
@@ -483,7 +483,7 @@ emp_act
if(prob(I.force * 2)) //blood spatter!
bloody = 1
var/turf/location = loc
if(istype(location, /turf/simulated))
if(issimulatedturf(location))
add_splatter_floor(location)
if(ishuman(user))
var/mob/living/carbon/human/H = user
@@ -542,7 +542,7 @@ emp_act
return spec_return
var/obj/item/I
var/throwpower = 30
if(istype(AM, /obj/item))
if(isitem(AM))
I = AM
throwpower = I.throwforce
if(locateUID(I.thrownby) == src) //No throwing stuff at yourself to trigger reactions
@@ -724,7 +724,7 @@ emp_act
/mob/living/carbon/human/experience_pressure_difference(pressure_difference, direction)
playsound(src, 'sound/effects/space_wind.ogg', 50, TRUE)
if(shoes && istype(shoes, /obj/item/clothing))
if(shoes && isclothing(shoes))
var/obj/item/clothing/S = shoes
if (S.flags & NOSLIP)
return FALSE
@@ -787,7 +787,7 @@
if(!disable_warning)
to_chat(H, "<span class='warning'>[I] is too big to attach.</span>")
return FALSE
if(istype(I, /obj/item/pda) || istype(I, /obj/item/pen) || is_type_in_list(I, H.wear_suit.allowed))
if(istype(I, /obj/item/pda) || is_pen(I) || is_type_in_list(I, H.wear_suit.allowed))
return TRUE
return FALSE
if(slot_handcuffed)
@@ -461,7 +461,7 @@
/datum/species/golem/bluespace/spec_hitby(atom/movable/AM, mob/living/carbon/human/H)
..()
var/obj/item/I
if(istype(AM, /obj/item))
if(isitem(AM))
I = AM
if(locateUID(I.thrownby) == H) //No throwing stuff at yourself to trigger the teleport
return 0
@@ -523,7 +523,7 @@
H.visible_message("<span class='warning'>[H] teleports!</span>", "<span class='danger'>You teleport!</span>")
var/list/turfs = new/list()
for(var/turf/T in orange(tele_range, H))
if(istype(T, /turf/space))
if(isspaceturf(T))
continue
if(T.density)
continue
@@ -606,7 +606,7 @@
/datum/species/golem/bananium/spec_hitby(atom/movable/AM, mob/living/carbon/human/H)
..()
var/obj/item/I
if(istype(AM, /obj/item))
if(isitem(AM))
I = AM
if(locateUID(I.thrownby) == H) //No throwing stuff at yourself to make bananas
return 0
+8 -8
View File
@@ -148,9 +148,9 @@
if(!(M.status_flags & CANPUSH))
return TRUE
//anti-riot equipment is also anti-push
if(M.r_hand && (prob(M.r_hand.block_chance * 2)) && !istype(M.r_hand, /obj/item/clothing))
if(M.r_hand && (prob(M.r_hand.block_chance * 2)) && !isclothing(M.r_hand))
return TRUE
if(M.l_hand && (prob(M.l_hand.block_chance * 2)) && !istype(M.l_hand, /obj/item/clothing))
if(M.l_hand && (prob(M.l_hand.block_chance * 2)) && !isclothing(M.l_hand))
return TRUE
//Called when we bump into an obj
@@ -355,12 +355,12 @@
for(var/obj/item/gift/G in Storage.return_inv()) //Check for gift-wrapped items
L += G.gift
if(istype(G.gift, /obj/item/storage))
if(isstorage(G.gift))
L += get_contents(G.gift)
for(var/obj/item/smallDelivery/D in Storage.return_inv()) //Check for package wrapped items
L += D.wrapped
if(istype(D.wrapped, /obj/item/storage)) //this should never happen
if(isstorage(D.wrapped)) //this should never happen
L += get_contents(D.wrapped)
return L
@@ -377,12 +377,12 @@
L += I.get_contents()
for(var/obj/item/gift/G in contents) //Check for gift-wrapped items
L += G.gift
if(istype(G.gift, /obj/item/storage))
if(isstorage(G.gift))
L += get_contents(G.gift)
for(var/obj/item/smallDelivery/D in contents) //Check for package wrapped items
L += D.wrapped
if(istype(D.wrapped, /obj/item/storage)) //this should never happen
if(isstorage(D.wrapped)) //this should never happen
L += get_contents(D.wrapped)
for(var/obj/item/folder/F in contents)
L += F.contents //Folders can't store any storage items.
@@ -923,14 +923,14 @@
/mob/living/proc/get_temperature(datum/gas_mixture/environment)
var/loc_temp = T0C
if(istype(loc, /obj/mecha))
if(ismecha(loc))
var/obj/mecha/M = loc
loc_temp = M.return_temperature()
else if(istype(loc, /obj/structure/transit_tube_pod))
loc_temp = environment.temperature
else if(istype(get_turf(src), /turf/space))
else if(isspaceturf(get_turf(src)))
var/turf/heat_turf = get_turf(src)
loc_temp = heat_turf.temperature
+2 -2
View File
@@ -71,7 +71,7 @@
to_chat(src, "Emergency control system online. Verifying connection to power network.")
sleep(50)
T = get_turf(src)
if(istype(T, /turf/space))
if(isspaceturf(T))
to_chat(src, "Unable to verify! No power connection detected!")
aiRestorePowerRoutine = 2
return
@@ -141,7 +141,7 @@
/mob/living/silicon/ai/proc/lacks_power()
var/turf/T = get_turf(src)
var/area/A = get_area(src)
return ((!A.power_equip) && A.requires_power == 1 || istype(T, /turf/space)) && !istype(src.loc,/obj/item)
return ((!A.power_equip) && A.requires_power == 1 || isspaceturf(T)) && !isitem(src.loc)
/mob/living/silicon/ai/rejuvenate()
..()
+1 -1
View File
@@ -9,7 +9,7 @@
var/atom/movable/whisper_loc = card
if(istype(card.loc, /obj/item/pda)) // Step up 1 level if in a PDA
whisper_loc = card.loc
if(istype(whisper_loc.loc, /mob/living))
if(isliving(whisper_loc.loc))
return whisper_loc.loc // allow a pai being held or in pocket to whisper
else
return whisper_loc // allow a pai in its card to whisper
@@ -89,7 +89,7 @@
var/count = 0
// Find the carrier
while(!istype(M, /mob/living))
while(!isliving(M))
if(!M || !M.loc || count > 6)
//For a runtime where M ends up in nullspace (similar to bluespace but less colourful)
if(inform)
@@ -112,7 +112,7 @@
else if(gripped_item && !contents.len)
gripped_item = null
else if(istype(target, /obj/item)) //Check that we're not pocketing a mob.
else if(isitem(target)) //Check that we're not pocketing a mob.
var/obj/item/I = target
if(is_type_in_typecache(I, can_hold)) // Make sure the item is something the gripper can hold
to_chat(user, "<span class='notice'>You collect [I].</span>")
+2 -2
View File
@@ -59,13 +59,13 @@
/mob/living/silicon/say_understands(other, datum/language/speaking = null)
//These only pertain to common. Languages are handled by mob/say_understands()
if(!speaking)
if(istype(other, /mob/living/carbon))
if(iscarbon(other))
return 1
if(istype(other, /mob/living/silicon))
return 1
if(istype(other, /mob/living/simple_animal/bot))
return 1
if(istype(other, /mob/living/carbon/brain))
if(isbrain(other))
return 1
return ..()
@@ -28,7 +28,7 @@
user.unEquip(src, 1)
qdel(src)
else if(istype(W, /obj/item/pen))
else if(is_pen(W))
var/t = rename_interactive(user, W, prompt = "Enter new robot name")
if(!isnull(t))
created_name = t
@@ -50,7 +50,7 @@
/obj/item/ed209_assembly/attackby(obj/item/W, mob/user, params)
..()
if(istype(W, /obj/item/pen))
if(is_pen(W))
var/t = rename_interactive(user, W, prompt = "Enter new robot name")
if(!isnull(t))
created_name = t
@@ -298,7 +298,7 @@
user.unEquip(src, 1)
qdel(src)
else if(istype(W, /obj/item/pen))
else if(is_pen(W))
var/t = rename_interactive(user, W, prompt = "Enter new robot name")
if(!isnull(t))
created_name = t
@@ -317,7 +317,7 @@
to_chat(user, "<span class='notice'>You add the robot arm to the odd looking toolbox assembly. Boop beep!</span>")
user.unEquip(src, 1)
qdel(src)
else if(istype(W, /obj/item/pen))
else if(is_pen(W))
var/t = rename_interactive(user, W, prompt = "Enter new robot name")
if(!isnull(t))
created_name = t
@@ -384,7 +384,7 @@
/obj/item/firstaid_arm_assembly/attackby(obj/item/I, mob/user, params)
..()
if(istype(I, /obj/item/pen))
if(is_pen(I))
var/t = rename_interactive(user, I, prompt = "Enter new robot name")
if(!isnull(t))
created_name = t
@@ -492,7 +492,7 @@
qdel(I)
qdel(src)
else if(istype(I, /obj/item/pen))
else if(is_pen(I))
var/t = rename_interactive(user, I, prompt = "Enter new robot name")
if(!isnull(t))
created_name = t
@@ -560,7 +560,7 @@
..()
/mob/living/simple_animal/bot/ed209/hitby(atom/movable/AM, skipcatch = FALSE, hitpush = TRUE, blocked = FALSE, datum/thrownthing/throwingdatum)
if(istype(AM, /obj/item))
if(isitem(AM))
var/obj/item/I = AM
var/mob/thrower = locateUID(I.thrownby)
if(I.throwforce < src.health && ishuman(thrower))
@@ -180,7 +180,7 @@
if(targetdirection != null) //The bot is in bridge mode.
//Try to find a space tile immediately in our selected direction.
var/turf/T = get_step(src, targetdirection)
if(istype(T, /turf/space))
if(isspaceturf(T))
target = T
else //Find a space tile farther way!
@@ -308,7 +308,7 @@
target = null
return
else if(!istype(target_turf, /turf/simulated/floor))
else if(!isfloorturf(target_turf))
return
if(amount <= 0)
@@ -136,7 +136,7 @@
bike_horn(A)
/mob/living/simple_animal/bot/honkbot/hitby(atom/movable/AM, skipcatch = FALSE, hitpush = TRUE, blocked = FALSE, datum/thrownthing/throwingdatum)
if(istype(AM, /obj/item))
if(isitem(AM))
playsound(src, honksound, 50, TRUE, -1)
var/obj/item/I = AM
var/mob/thrower = locateUID(I.thrownby)
@@ -370,7 +370,7 @@
//I'm sure someone will come along and ask why this is here... well people were dragging screen items onto the mule, and that was not cool.
//So this is a simple fix that only allows a selection of item types to be considered. Further narrowing-down is below.
if(!istype(AM, /obj/item) && !istype(AM, /obj/machinery) && !istype(AM, /obj/structure) && !ismob(AM))
if(!isitem(AM) && !ismachinery(AM) && !istype(AM, /obj/structure) && !ismob(AM))
return
if(!isturf(AM.loc)) //To prevent the loading from stuff from someone's inventory or screen icons.
return
@@ -235,7 +235,7 @@
/mob/living/simple_animal/bot/secbot/hitby(atom/movable/AM, skipcatch = FALSE, hitpush = TRUE, blocked = FALSE, datum/thrownthing/throwingdatum)
if(istype(AM, /obj/item))
if(isitem(AM))
var/obj/item/I = AM
var/mob/thrower = locateUID(I.thrownby)
if(I.throwforce < src.health && ishuman(thrower))
@@ -450,7 +450,7 @@ Difficulty: Medium
M.take_damage(45, BRUTE, MELEE, 1)
// changes turf to lava temporarily
if(!T.density && !istype(T, /turf/simulated/floor/plating/lava))
if(!T.density && !islava(T))
var/lava_turf = /turf/simulated/floor/plating/lava/smooth
var/reset_turf = T.type
T.ChangeTurf(lava_turf)
@@ -150,7 +150,7 @@
var/chosen_attack_num = 0
/datum/action/innate/megafauna_attack/Grant(mob/living/L)
if(istype(L, /mob/living/simple_animal/hostile/megafauna))
if(ismegafauna(L))
M = L
return ..()
return FALSE
@@ -147,7 +147,7 @@ GLOBAL_LIST_INIT(protected_objects, list(/obj/structure/table, /obj/structure/ca
faction |= "\ref[owner]"
/mob/living/simple_animal/hostile/mimic/copy/proc/CheckObject(obj/O)
if((istype(O, /obj/item) || istype(O, /obj/structure)) && !is_type_in_list(O, GLOB.protected_objects))
if((isitem(O) || istype(O, /obj/structure)) && !is_type_in_list(O, GLOB.protected_objects))
return 1
return 0
@@ -162,16 +162,16 @@ GLOBAL_LIST_INIT(protected_objects, list(/obj/structure/table, /obj/structure/ca
overlays = O.overlays
googly_eyes = image('icons/mob/mob.dmi',"googly_eyes")
overlays += googly_eyes
if(istype(O, /obj/structure) || istype(O, /obj/machinery))
if(istype(O, /obj/structure) || ismachinery(O))
health = (anchored * 50) + 50
destroy_objects = 1
if(O.density && O.anchored)
knockdown_people = 1
melee_damage_lower *= 2
melee_damage_upper *= 2
if(istype(O, /obj/machinery))
if(ismachinery(O))
is_electronic = 1
else if(istype(O, /obj/item))
else if(isitem(O))
var/obj/item/I = O
health = 15 * I.w_class
melee_damage_lower = 2 + I.force
@@ -61,7 +61,7 @@
if(ismineralturf(target))
var/turf/simulated/mineral/M = target
M.gets_drilled()
if(istype(target, /obj/mecha))
if(ismecha(target))
var/obj/mecha/M = target
M.take_damage(50, BRUTE, MELEE, 1)
if(. && isliving(target)) //Taken from megafauna. This exists purely to stop someone from cheesing a weaker melee fauna by letting it get punched.
@@ -44,7 +44,7 @@
..()
/mob/living/simple_animal/hostile/asteroid/hitby(atom/movable/AM, skipcatch, hitpush, blocked, datum/thrownthing/throwingdatum) //No floor tiling them to death, wiseguy
if(istype(AM, /obj/item))
if(isitem(AM))
var/obj/item/T = AM
if(!stat)
Aggro()
@@ -170,7 +170,7 @@
/mob/living/simple_animal/hostile/mushroom/hitby(atom/movable/AM, skipcatch = FALSE, hitpush = TRUE, blocked = FALSE, datum/thrownthing/throwingdatum)
..()
if(istype(AM, /obj/item))
if(isitem(AM))
var/obj/item/T = AM
if(T.throwforce)
Bruise()
@@ -150,10 +150,10 @@
return //Trying to eat part of self.
if(istype(noms, /turf))
if(istype(noms, /turf/simulated/wall))
if(iswallturf(noms))
W = noms
nomDelay *= 2
if(istype(W, /turf/simulated/wall/r_wall))
if(isreinforcedwallturf(W))
nomDelay *= 2
else
return
@@ -138,7 +138,7 @@
depotarea.saw_double_agent(M)
depotarea.declare_started()
seen_enemy_name = target.name
if(istype(target, /obj/mecha))
if(ismecha(target))
depotarea.saw_mech(target)
if(depotarea.list_includes(target, depotarea.dead_list))
seen_revived_enemy = TRUE
@@ -145,7 +145,7 @@
if(do_after(src, delay_web, target = loc))
if(loc != mylocation)
return
else if(istype(loc, /turf/space))
else if(isspaceturf(loc))
to_chat(src, "<span class='danger'>Webs cannot be spun in space.</span>")
else
var/obj/structure/spider/terrorweb/T = locate() in get_turf(src)
@@ -264,9 +264,9 @@
cocoon_target.extinguish_light()
for(var/obj/O in C.loc)
if(!O.anchored)
if(istype(O, /obj/item))
if(isitem(O))
O.loc = C
else if(istype(O, /obj/machinery))
else if(ismachinery(O))
O.loc = C
large_cocoon = 1
else if(istype(O, /obj/structure) && !istype(O, /obj/structure/spider)) // can't wrap spiderlings/etc
@@ -181,7 +181,7 @@
var/mob/living/M = A
if(!("terrorspiders" in M.faction))
enemies |= M
else if(istype(A, /obj/mecha))
else if(ismecha(A))
var/obj/mecha/M = A
if(M.occupant)
enemies |= M
@@ -225,7 +225,7 @@
for(var/obj/O in can_see)
if(O.anchored)
continue
if(istype(O, /obj/item) || istype(O, /obj/structure) || istype(O, /obj/machinery))
if(isitem(O) || istype(O, /obj/structure) || ismachinery(O))
if(!istype(O, /obj/item/paper))
cocoon_target = O
stop_automated_movement = TRUE
@@ -368,7 +368,7 @@
if(!held_item && !parrot_perch) //If we've got nothing to do.. look for something to do.
var/atom/movable/AM = search_for_perch_and_item() //This handles checking through lists so we know it's either a perch or stealable item
if(AM)
if(istype(AM, /obj/item) || isliving(AM)) //If stealable item
if(isitem(AM) || isliving(AM)) //If stealable item
parrot_interest = AM
parrot_state = PARROT_SWOOP|PARROT_STEAL
face_atom(AM)
@@ -81,7 +81,7 @@
/mob/living/simple_animal/possessed_object/New(atom/loc as obj)
..()
if(!istype(loc, /obj/item)) // Some silly motherfucker spawned us directly via the game panel.
if(!isitem(loc)) // Some silly motherfucker spawned us directly via the game panel.
message_admins("<span class='adminnotice'>Posessed object improperly spawned, deleting.</span>") // So silly admins with debug off will see the message too and not spam these things.
stack_trace("[src] spawned manually, no object to assign attributes to.")
qdel(src)
+5 -5
View File
@@ -247,7 +247,7 @@
equip_to_slot_or_del(W, slot, initial)
else
//Mob can't equip it. Put it their backpack or toss it on the floor
if(istype(back, /obj/item/storage))
if(isstorage(back))
var/obj/item/storage/S = back
//Now, B represents a container we can insert W into.
S.handle_item_insertion(W,1)
@@ -463,7 +463,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) || istype(src, /obj/item/pen) || is_type_in_list(src, H.wear_suit.allowed) )
if( istype(src, /obj/item/pda) || is_pen(src) || is_type_in_list(src, H.wear_suit.allowed) )
if(H.s_store)
if(!(H.s_store.flags & NODROP))
return 2
@@ -856,7 +856,7 @@ GLOBAL_LIST_INIT(slot_equipment_priority, list( \
set category = "OOC"
reset_perspective(null)
unset_machine()
if(istype(src, /mob/living))
if(isliving(src))
if(src:cameraFollow)
src:cameraFollow = null
@@ -973,7 +973,7 @@ GLOBAL_LIST_INIT(slot_equipment_priority, list( \
if(mob_spell_list && mob_spell_list.len)
for(var/obj/effect/proc_holder/spell/S in mob_spell_list)
add_spell_to_statpanel(S)
if(mind && istype(src, /mob/living) && mind.spell_list && mind.spell_list.len)
if(mind && isliving(src) && mind.spell_list && mind.spell_list.len)
for(var/obj/effect/proc_holder/spell/S in mind.spell_list)
add_spell_to_statpanel(S)
@@ -1187,7 +1187,7 @@ GLOBAL_LIST_INIT(slot_equipment_priority, list( \
if(stat==DEAD)
return
var/turf/location = loc
if(istype(location, /turf/simulated))
if(issimulatedturf(location))
if(green)
if(!no_text)
visible_message("<span class='warning'>[src] vomits up some green goo!</span>","<span class='warning'>You vomit up some green goo!</span>")
+1 -1
View File
@@ -145,7 +145,7 @@
/proc/iscuffed(A)
if(istype(A, /mob/living/carbon))
if(iscarbon(A))
var/mob/living/carbon/C = A
if(C.handcuffed)
return 1
+1 -1
View File
@@ -321,7 +321,7 @@
continue
else if(isturf(A))
var/turf/turf = A
if(istype(turf, /turf/space))
if(isspaceturf(turf))
continue
if(!turf.density && !mob_negates_gravity())
continue
@@ -43,7 +43,7 @@
if(src.dna)
M.dna = src.dna.Clone()
if((mind && istype(M, /mob/living)) && !forcekey)
if((mind && isliving(M)) && !forcekey)
mind.transfer_to(M)
else
M.key = key