mirror of
https://github.com/ParadiseSS13/Paradise.git
synced 2026-08-24 20:47:10 +01:00
Removes all mentions of return . where they would be unnecessary (#25142)
* Removes all mentions of `return .` * I can do this all day * Arthri review * Update code/__HELPERS/sanitize_values.dm Co-authored-by: Burzah <116982774+Burzah@users.noreply.github.com> * Update code/__HELPERS/sanitize_values.dm Co-authored-by: Burzah <116982774+Burzah@users.noreply.github.com> --------- Co-authored-by: Burzah <116982774+Burzah@users.noreply.github.com>
This commit is contained in:
@@ -14,4 +14,4 @@
|
||||
#define MARTIAL_COMBO_STEP_HELP "Help"
|
||||
|
||||
// A check used for all act types. Such as disarm_act
|
||||
#define MARTIAL_ARTS_ACT_CHECK if((. = ..()) != FALSE) return .
|
||||
#define MARTIAL_ARTS_ACT_CHECK if((. = ..()) != FALSE) return
|
||||
|
||||
@@ -242,7 +242,6 @@
|
||||
continue
|
||||
if(is_same_root_atom(M, speaker_coverage[ear]))
|
||||
. |= M
|
||||
return .
|
||||
|
||||
/proc/inLineOfSight(X1,Y1,X2,Y2,Z=1,PX1=16.5,PY1=16.5,PX2=16.5,PY2=16.5)
|
||||
var/turf/T
|
||||
|
||||
@@ -189,7 +189,6 @@
|
||||
return min(max(. + rand(-25, 25), -185), 34)
|
||||
else if(species == "Vox")
|
||||
. = rand(1, 6)
|
||||
return .
|
||||
|
||||
/proc/skintone2racedescription(tone, species = "Human")
|
||||
if(species == "Human")
|
||||
|
||||
@@ -12,9 +12,12 @@
|
||||
return default
|
||||
|
||||
/proc/sanitize_inlist(value, list/List, default)
|
||||
if(value in List) return value
|
||||
if(default) return default
|
||||
if(length(List)) return pick(List)
|
||||
if(value in List)
|
||||
return value
|
||||
if(default)
|
||||
return default
|
||||
if(length(List))
|
||||
return pick(List)
|
||||
|
||||
/proc/sanitize_json(json_input)
|
||||
if(length(json_input) && istext(json_input))
|
||||
@@ -35,19 +38,25 @@
|
||||
return default
|
||||
|
||||
/proc/sanitize_hexcolor(color, default="#000000")
|
||||
if(!istext(color)) return default
|
||||
if(!istext(color))
|
||||
return default
|
||||
var/len = length(color)
|
||||
if(len != 7 && len !=4) return default
|
||||
if(text2ascii(color,1) != 35) return default //35 is the ascii code for "#"
|
||||
if(len != 7 && len !=4)
|
||||
return default
|
||||
if(text2ascii(color, 1) != 35)
|
||||
return default //35 is the ascii code for "#"
|
||||
. = "#"
|
||||
for(var/i=2,i<=len,i++)
|
||||
var/ascii = text2ascii(color,i)
|
||||
switch(ascii)
|
||||
if(48 to 57) . += ascii2text(ascii) //numbers 0 to 9
|
||||
if(97 to 102) . += ascii2text(ascii) //letters a to f
|
||||
if(65 to 70) . += ascii2text(ascii+32) //letters A to F - translates to lowercase
|
||||
else return default
|
||||
return .
|
||||
if(48 to 57)
|
||||
. += ascii2text(ascii) //numbers 0 to 9
|
||||
if(97 to 102)
|
||||
. += ascii2text(ascii) //letters a to f
|
||||
if(65 to 70)
|
||||
. += ascii2text(ascii + 32) //letters A to F - translates to lowercase
|
||||
else
|
||||
return default
|
||||
|
||||
/proc/sanitize_ooccolor(color)
|
||||
var/list/HSL = rgb2hsl(hex2num(copytext(color,2,4)),hex2num(copytext(color,4,6)),hex2num(copytext(color,6,8)))
|
||||
|
||||
@@ -193,7 +193,6 @@
|
||||
if(rights & R_MENTOR) . += "[seperator]+MENTOR"
|
||||
if(rights & R_VIEWRUNTIMES) . += "[seperator]+VIEWRUNTIMES"
|
||||
if(rights & R_MAINTAINER) . += "[seperator]+MAINTAINER"
|
||||
return .
|
||||
|
||||
/proc/ui_style2icon(ui_style)
|
||||
switch(ui_style)
|
||||
|
||||
@@ -323,7 +323,6 @@
|
||||
if(A.control_disabled)
|
||||
continue
|
||||
. += A
|
||||
return .
|
||||
|
||||
//Find an active ai with the least borgs. VERBOSE PROCNAME HUH!
|
||||
/proc/select_active_ai_with_fewest_borgs()
|
||||
|
||||
@@ -53,7 +53,6 @@
|
||||
return 0
|
||||
if((reagents?(length(reagents)):(0)) < length(avail_reagents.reagent_list))
|
||||
return -1
|
||||
return .
|
||||
|
||||
/datum/recipe/proc/check_items(obj/container, list/ignored_items = null) //1=precisely, 0=insufficiently, -1=superfluous
|
||||
. = 1
|
||||
@@ -73,7 +72,6 @@
|
||||
. = -1
|
||||
if(length(checklist))
|
||||
return 0
|
||||
return .
|
||||
|
||||
//general version
|
||||
/datum/recipe/proc/make(obj/container)
|
||||
@@ -118,7 +116,6 @@
|
||||
r_count = N_r
|
||||
i_count = N_i
|
||||
. = recipe
|
||||
return .
|
||||
|
||||
/datum/recipe/proc/get_byproduct()
|
||||
if(byproduct)
|
||||
|
||||
@@ -68,8 +68,6 @@
|
||||
|
||||
. += "/([name])"
|
||||
|
||||
return .
|
||||
|
||||
/proc/key_name_admin(whom)
|
||||
if(whom)
|
||||
var/datum/whom_datum = whom //As long as it's not null, will be close enough/has the proc UID() that is all that's needed
|
||||
|
||||
@@ -439,7 +439,6 @@
|
||||
. = ..()
|
||||
if(.)
|
||||
user.mind.AddSpell(new /datum/spell/aoe/conjure/construct(null))
|
||||
return .
|
||||
|
||||
/datum/spellbook_entry/item/wands
|
||||
name = "Wand Assortment"
|
||||
|
||||
@@ -93,7 +93,7 @@
|
||||
/obj/machinery/iv_drip/Move(NewLoc, direct)
|
||||
. = ..()
|
||||
if(!.) // ..() will return 0 if we didn't actually move anywhere.
|
||||
return .
|
||||
return
|
||||
playsound(loc, pick('sound/items/cartwheel1.ogg', 'sound/items/cartwheel2.ogg'), 100, 1, ignore_walls = FALSE)
|
||||
|
||||
#undef IV_TAKING
|
||||
|
||||
@@ -799,10 +799,10 @@
|
||||
|
||||
. = ..()
|
||||
if(!.) // ..() will return 0 if we didn't actually move anywhere.
|
||||
return .
|
||||
return
|
||||
|
||||
if(direct & (direct - 1)) // This represents a diagonal movement, which is split into multiple cardinal movements. We'll handle moving the items on the cardinals only.
|
||||
return .
|
||||
return
|
||||
|
||||
playsound(loc, pick('sound/items/cartwheel1.ogg', 'sound/items/cartwheel2.ogg'), 100, 1, ignore_walls = FALSE)
|
||||
|
||||
|
||||
@@ -207,7 +207,7 @@
|
||||
if(log_info)
|
||||
INVOKE_ASYNC(GLOBAL_PROC, GLOBAL_PROC_REF(log_connection), ckey(key), address, computer_id, CONNECTION_TYPE_DROPPED_BANNED)
|
||||
qdel(query)
|
||||
return .
|
||||
return
|
||||
qdel(query)
|
||||
|
||||
. = ..() //default pager ban stuff
|
||||
@@ -224,4 +224,3 @@
|
||||
log_adminwarn("Failed Login: [key] [computer_id] [address] - Banned [.["message"]]")
|
||||
if(log_info)
|
||||
INVOKE_ASYNC(GLOBAL_PROC, GLOBAL_PROC_REF(log_connection), ckey(key), address, computer_id, CONNECTION_TYPE_DROPPED_BANNED)
|
||||
return .
|
||||
|
||||
@@ -12,7 +12,7 @@
|
||||
var/mob/living/carbon/human/human_user = user
|
||||
|
||||
if(!species_custom_messages || (human_user.mind?.miming && !species_custom_mime_messages))
|
||||
return .
|
||||
return
|
||||
|
||||
var/custom_message
|
||||
if(user.mind?.miming)
|
||||
|
||||
@@ -317,7 +317,7 @@
|
||||
ADD_SLOWDOWN(H.r_hand.slowdown)
|
||||
|
||||
if(ignoreslow)
|
||||
return . // Only malusses after here
|
||||
return // Only malusses after here
|
||||
|
||||
if(H.dna.species.spec_movement_delay()) //Species overrides for slowdown due to feet/legs
|
||||
. += 2 * H.stance_damage //damaged/missing feet or legs is slow
|
||||
|
||||
@@ -11,7 +11,6 @@
|
||||
. = ..()
|
||||
if(user.mind?.miming)
|
||||
return FALSE // shh
|
||||
return .
|
||||
|
||||
/datum/emote/living/blush
|
||||
key = "blush"
|
||||
|
||||
@@ -20,5 +20,3 @@
|
||||
|
||||
//Should update regardless of if we can ventcrawl, since we can end up in pipes in other ways.
|
||||
update_pipe_vision(loc)
|
||||
|
||||
return .
|
||||
|
||||
@@ -8,7 +8,6 @@
|
||||
var/mob/living/L = target
|
||||
if(L.reagents && !poison_per_bite == 0)
|
||||
L.reagents.add_reagent(poison_type, poison_per_bite)
|
||||
return .
|
||||
|
||||
/mob/living/simple_animal/hostile/retaliate/poison/snake
|
||||
name = "snake"
|
||||
|
||||
@@ -74,7 +74,7 @@
|
||||
/mob/living/carbon/human/get_screen_colour() //Fetch the colour matrix from wherever (e.g. eyes) so it can be compared to client.color.
|
||||
. = ..()
|
||||
if(.)
|
||||
return .
|
||||
return
|
||||
|
||||
var/obj/item/clothing/glasses/worn_glasses = glasses
|
||||
var/obj/item/organ/internal/eyes/eyes = get_int_organ(/obj/item/organ/internal/eyes)
|
||||
|
||||
@@ -336,8 +336,6 @@ By design, d1 is the smallest direction and d2 is the highest
|
||||
T = get_turf(src)
|
||||
. += T.power_list(src, d2) //get on turf matching cables
|
||||
|
||||
return .
|
||||
|
||||
//should be called after placing a cable which extends another cable, creating a "smooth" cable that no longer terminates in the centre of a turf.
|
||||
//needed as this can, unlike other placements, disconnect cables
|
||||
/obj/structure/cable/proc/denode()
|
||||
|
||||
@@ -117,7 +117,7 @@
|
||||
/obj/structure/cursed_money/attack_hand(mob/living/user)
|
||||
. = ..()
|
||||
if(.)
|
||||
return .
|
||||
return
|
||||
|
||||
user.visible_message("<span class='warning'>[user] opens the bag and \
|
||||
and removes a die. The bag then vanishes.</span>",
|
||||
|
||||
@@ -185,12 +185,6 @@
|
||||
//returns first-found touching shuttleport
|
||||
/obj/docking_port/stationary/get_docked()
|
||||
return locate(/obj/docking_port/mobile) in loc
|
||||
/*
|
||||
for(var/turf/T in return_ordered_turfs())
|
||||
. = locate(/obj/docking_port/mobile) in loc
|
||||
if(.)
|
||||
return .
|
||||
*/
|
||||
|
||||
/obj/docking_port/stationary/transit
|
||||
name = "In transit"
|
||||
|
||||
Reference in New Issue
Block a user