Bools and returns super-pr (#53221)

Replaces like 70-80% of 0 and such, as a side effect cleaned up a bunch of returns
Edit: Most left out ones are in mecha which should be done in mecha refactor already
Oh my look how clean it is

Co-authored-by: TiviPlus <TiviPlus>
Co-authored-by: Couls <coul422@gmail.com>
This commit is contained in:
TiviPlus
2020-08-28 23:26:37 +02:00
committed by GitHub
parent cb49d3301b
commit ca366c3ea1
355 changed files with 1549 additions and 1591 deletions
+1 -1
View File
@@ -220,7 +220,7 @@
desc = "The perfect showcase for your favorite deathtrap memories."
icon = 'icons/obj/decals.dmi'
custom_materials = list(/datum/material/wood = 2000)
flags_1 = 0
flags_1 = NONE
icon_state = "frame-empty"
result_path = /obj/structure/sign/painting
@@ -79,9 +79,9 @@
. = ..()
if(over_object == usr && Adjacent(usr))
if(!ishuman(usr) || !usr.canUseTopic(src, BE_CLOSE))
return 0
return FALSE
if(has_buckled_mobs())
return 0
return FALSE
usr.visible_message("<span class='notice'>[usr] collapses \the [src.name].</span>", "<span class='notice'>You collapse \the [src.name].</span>")
var/obj/structure/bed/roller/B = new foldabletype(get_turf(src))
usr.put_in_hands(B)
@@ -325,8 +325,8 @@
/obj/item/chair/hit_reaction(mob/living/carbon/human/owner, atom/movable/hitby, attack_text = "the attack", final_block_chance = 0, damage = 0, attack_type = MELEE_ATTACK)
if(attack_type == UNARMED_ATTACK && prob(hit_reaction_chance))
owner.visible_message("<span class='danger'>[owner] fends off [attack_text] with [src]!</span>")
return 1
return 0
return TRUE
return FALSE
/obj/item/chair/afterattack(atom/target, mob/living/carbon/user, proximity)
. = ..()
@@ -393,8 +393,8 @@
/obj/structure/closet/Exit(atom/movable/AM)
open()
if(AM.loc == src)
return 0
return 1
return FALSE
return TRUE
/obj/structure/closet/container_resist_act(mob/living/user)
if(opened)
@@ -18,7 +18,7 @@
drag_slowdown = 0
var/foldedbag_path = /obj/item/bodybag
var/obj/item/bodybag/foldedbag_instance = null
var/tagged = 0 // so closet code knows to put the tag overlay back
var/tagged = FALSE // so closet code knows to put the tag overlay back
/obj/structure/closet/body_bag/Destroy()
// If we have a stored bag, and it's in nullspace (not in someone's hand), delete it.
@@ -38,7 +38,7 @@
return
if(t)
name = "body bag - [t]"
tagged = 1
tagged = TRUE
update_icon()
else
name = "body bag"
@@ -46,7 +46,7 @@
else if(I.tool_behaviour == TOOL_WIRECUTTER)
to_chat(user, "<span class='notice'>You cut the tag off [src].</span>")
name = "body bag"
tagged = 0
tagged = FALSE
update_icon()
/obj/structure/closet/body_bag/update_overlays()
+2 -2
View File
@@ -45,7 +45,7 @@
return
to_chat(user, "<span class='notice'>You start fixing [src]...</span>")
if(do_after(user, 20, target = src) && G.use(2))
broken = 0
broken = FALSE
obj_integrity = max_integrity
update_icon()
else if(open || broken)
@@ -75,7 +75,7 @@
if(BURN)
playsound(src.loc, 'sound/items/welder.ogg', 100, TRUE)
/obj/structure/fireaxecabinet/take_damage(damage_amount, damage_type = BRUTE, damage_flag = 0, sound_effect = 1, attack_dir)
/obj/structure/fireaxecabinet/take_damage(damage_amount, damage_type = BRUTE, damage_flag = 0, sound_effect = TRUE, attack_dir)
if(open)
return
. = ..()
+2 -2
View File
@@ -361,7 +361,7 @@
var/obj/item/stack/sheet/runed_metal/R = W
if(R.get_amount() < 1)
to_chat(user, "<span class='warning'>You need at least one sheet of runed metal to construct a runed wall!</span>")
return 0
return
user.visible_message("<span class='notice'>[user] begins laying runed metal on [src]...</span>", "<span class='notice'>You begin constructing a runed wall...</span>")
if(do_after(user, 50, target = src))
if(R.get_amount() < 1)
@@ -428,7 +428,7 @@
var/obj/item/stack/tile/bronze/B = W
if(B.get_amount() < 2)
to_chat(user, "<span class='warning'>You need at least two bronze sheets to build a bronze wall!</span>")
return 0
return
user.visible_message("<span class='notice'>[user] begins plating [src] with bronze...</span>", "<span class='notice'>You begin constructing a bronze wall...</span>")
if(do_after(user, 50, target = src))
if(B.get_amount() < 2)
+1 -1
View File
@@ -21,7 +21,7 @@
anchored = TRUE
density = TRUE
max_buckled_mobs = 1
buckle_lying = FALSE
buckle_lying = 0
buckle_prevents_pull = TRUE
layer = ABOVE_MOB_LAYER
var/blade_status = GUILLOTINE_BLADE_RAISED
+2 -2
View File
@@ -23,13 +23,13 @@
/obj/structure/janitorialcart/proc/wet_mop(obj/item/mop, mob/user)
if(reagents.total_volume < 1)
to_chat(user, "<span class='warning'>[src] is out of water!</span>")
return 0
return FALSE
else
var/obj/item/mop/M = mop
reagents.trans_to(mop, M.mopcap, transfered_by = user)
to_chat(user, "<span class='notice'>You wet [mop] in [src].</span>")
playsound(loc, 'sound/effects/slosh.ogg', 25, TRUE)
return 1
return TRUE
/obj/structure/janitorialcart/proc/put_in_cart(obj/item/I, mob/user)
if(!user.transferItemToLoc(I, src))
@@ -77,28 +77,28 @@
/mob/living/carbon/human/petrify(statue_timer)
if(!isturf(loc))
return 0
return FALSE
var/obj/structure/statue/petrified/S = new(loc, src, statue_timer)
S.name = "statue of [name]"
bleedsuppress = 1
S.copy_overlays(src)
var/newcolor = list(rgb(77,77,77), rgb(150,150,150), rgb(28,28,28), rgb(0,0,0))
S.add_atom_colour(newcolor, FIXED_COLOUR_PRIORITY)
return 1
return TRUE
/mob/living/carbon/monkey/petrify(statue_timer)
if(!isturf(loc))
return 0
return FALSE
var/obj/structure/statue/petrified/S = new(loc, src, statue_timer)
S.name = "statue of a monkey"
S.icon_state = "monkey"
return 1
return TRUE
/mob/living/simple_animal/pet/dog/corgi/petrify(statue_timer)
if(!isturf(loc))
return 0
return FALSE
var/obj/structure/statue/petrified/S = new (loc, src, statue_timer)
S.name = "statue of a corgi"
S.icon_state = "corgi"
S.desc = "If it takes forever, I will wait for you..."
return 1
return TRUE
+4 -4
View File
@@ -227,7 +227,7 @@
material_drop_type = /obj/item/stack/sheet/mineral/bananium
impressiveness = 50
desc = "A bananium statue with a small engraving:'HOOOOOOONK'."
var/spam_flag = 0
var/limiting_spam = FALSE
/obj/structure/statue/bananium/clown
name = "statue of a clown"
@@ -250,10 +250,10 @@
..()
/obj/structure/statue/bananium/proc/honk()
if(!spam_flag)
spam_flag = TRUE
if(!limiting_spam)
limiting_spam = TRUE
playsound(src.loc, 'sound/items/bikehorn.ogg', 50, TRUE)
addtimer(VARSET_CALLBACK(src, spam_flag, FALSE), 2 SECONDS)
addtimer(VARSET_CALLBACK(src, limiting_spam, FALSE), 2 SECONDS)
/////////////////////sandstone/////////////////////////////////////////
+1 -1
View File
@@ -536,7 +536,7 @@
canSmoothWith = null
can_buckle = 1
buckle_lying = -1
buckle_requires_restraints = 1
buckle_requires_restraints = TRUE
var/mob/living/carbon/human/patient = null
var/obj/machinery/computer/operating/computer = null
@@ -9,7 +9,7 @@
density = FALSE
layer = LOW_ITEM_LAYER //same as the built tube
anchored = FALSE
var/flipped = 0
var/flipped = FALSE
var/build_type = /obj/structure/transit_tube
var/flipped_build_type
var/base_icon
@@ -62,7 +62,7 @@
/obj/structure/c_transit_tube/station/flipped
icon_state = "closed_station1"
flipped = 1
flipped = TRUE
build_type = /obj/structure/transit_tube/station/flipped
flipped_build_type = /obj/structure/transit_tube/station
@@ -77,7 +77,7 @@
/obj/structure/c_transit_tube/station/reverse/flipped
icon_state = "closed_terminus1"
flipped = 1
flipped = TRUE
build_type = /obj/structure/transit_tube/station/reverse/flipped
flipped_build_type = /obj/structure/transit_tube/station/reverse
@@ -91,7 +91,7 @@
/obj/structure/c_transit_tube/station/dispenser/flipped
icon_state = "closed_station1"
flipped = 1
flipped = TRUE
build_type = /obj/structure/transit_tube/station/dispenser/flipped
flipped_build_type = /obj/structure/transit_tube/station/dispenser
@@ -106,7 +106,7 @@
/obj/structure/c_transit_tube/station/dispenser/reverse/flipped
icon_state = "closed_terminus1"
flipped = 1
flipped = TRUE
build_type = /obj/structure/transit_tube/station/dispenser/reverse/flipped
flipped_build_type = /obj/structure/transit_tube/station/dispenser/reverse
@@ -136,7 +136,7 @@
icon_state = "curved1"
build_type = /obj/structure/transit_tube/curved/flipped
flipped_build_type = /obj/structure/transit_tube/curved
flipped = 1
flipped = TRUE
/obj/structure/c_transit_tube/junction
@@ -148,7 +148,7 @@
/obj/structure/c_transit_tube/junction/flipped
icon_state = "junction1"
flipped = 1
flipped = TRUE
build_type = /obj/structure/transit_tube/junction/flipped
flipped_build_type = /obj/structure/transit_tube/junction
@@ -98,7 +98,7 @@
return ..()
/obj/structure/transit_tube_pod/proc/follow_tube()
set waitfor = 0
set waitfor = FALSE
if(moving)
return
+10 -10
View File
@@ -99,9 +99,9 @@
/obj/structure/window/CanAllowThrough(atom/movable/mover, turf/target)
. = ..()
if(istype(mover) && (mover.pass_flags & PASSGLASS))
return 1
return TRUE
if(dir == FULLTILE_WINDOW_DIR)
return 0 //full tile window, you can't move into it!
return FALSE //full tile window, you can't move into it!
var/attempted_dir = get_dir(loc, target)
if(attempted_dir == dir)
return
@@ -120,10 +120,10 @@
/obj/structure/window/CheckExit(atom/movable/O, turf/target)
if(istype(O) && (O.pass_flags & PASSGLASS))
return 1
return TRUE
if(get_dir(O.loc, target) == dir)
return 0
return 1
return FALSE
return TRUE
/obj/structure/window/attack_tk(mob/user)
user.changeNext_move(CLICK_CD_MELEE)
@@ -227,8 +227,8 @@
if(get_dir(user,src) & dir)
for(var/obj/O in loc)
if(!O.CanPass(user, user.loc, 1))
return 0
return 1
return FALSE
return TRUE
/obj/structure/window/take_damage(damage_amount, damage_type = BRUTE, damage_flag = 0, sound_effect = 1)
. = ..()
@@ -337,11 +337,11 @@
/obj/structure/window/CanAStarPass(ID, to_dir)
if(!density)
return 1
return TRUE
if((dir == FULLTILE_WINDOW_DIR) || (dir == to_dir))
return 0
return FALSE
return 1
return TRUE
/obj/structure/window/GetExplosionBlock()
return reinf && fulltile ? real_explosion_block : 0