Skip to content

Commit

Permalink
KILL (#10009)
Browse files Browse the repository at this point in the history
  • Loading branch information
Tsar-Salat authored Oct 12, 2023
1 parent 08401e8 commit 05f763f
Show file tree
Hide file tree
Showing 130 changed files with 242 additions and 247 deletions.
15 changes: 5 additions & 10 deletions code/__DEFINES/maths.dm
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
#define TICK_USAGE_TO_MS(starting_tickusage) (TICK_DELTA_TO_MS(TICK_USAGE_REAL - starting_tickusage))

#define PERCENT(val) (round((val)*100, 0.1))
#define CLAMP01(x) (CLAMP(x, 0, 1))
#define CLAMP01(x) (clamp(x, 0, 1))

//time of day but automatically adjusts to the server going into the next day within the same round.
//for when you need a reliable time number that doesn't depend on byond time.
Expand All @@ -39,19 +39,14 @@
/// `round()` acts like `floor(x, 1)` by default but can't handle other values
#define FLOOR(x, y) ( round((x) / (y)) * (y) )

#define CLAMP(CLVALUE,CLMIN,CLMAX) clamp(CLVALUE, CLMIN, CLMAX)

/// Similar to clamp but the bottom rolls around to the top and vice versa. min is inclusive, max is exclusive
#define WRAP(val, min, max) ( min == max ? min : (val) - (round(((val) - (min))/((max) - (min))) * ((max) - (min))) )

/// Real modulus that handles decimals
#define MODULUS(x, y) ( (x) - FLOOR(x, y))

/// Tangent
#define TAN(x) tan(x)

/// Cotangent
#define COT(x) (1 / TAN(x))
#define COT(x) (1 / tan(x))

/// Secant
#define SEC(x) (1 / cos(x))
Expand Down Expand Up @@ -191,8 +186,8 @@
while(pixel_y < -16)
pixel_y += 32
new_y--
new_x = CLAMP(new_x, 0, world.maxx)
new_y = CLAMP(new_y, 0, world.maxy)
new_x = clamp(new_x, 0, world.maxx)
new_y = clamp(new_y, 0, world.maxy)
return locate(new_x, new_y, starting.z)

/// Returns a list where [1] is all x values and [2] is all y values that overlap between the given pair of rectangles
Expand All @@ -217,7 +212,7 @@

#define EXP_DISTRIBUTION(desired_mean) ( -(1/(1/desired_mean)) * log(rand(1, 1000) * 0.001) )

#define LORENTZ_DISTRIBUTION(x, s) ( s*TAN(TODEGREES(PI*(rand()-0.5))) + x )
#define LORENTZ_DISTRIBUTION(x, s) ( s*tan(TODEGREES(PI*(rand()-0.5))) + x )
#define LORENTZ_CUMULATIVE_DISTRIBUTION(x, y, s) ( (1/PI)*TORADIANS(arctan((x-y)/s)) + 1/2 )

#define RULE_OF_THREE(a, b, x) ((a*x)/b)
Expand Down
4 changes: 2 additions & 2 deletions code/__HELPERS/radio.dm
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@
/proc/sanitize_frequency(frequency, free = FALSE)
. = round(frequency)
if(free)
. = CLAMP(frequency, MIN_FREE_FREQ, MAX_FREE_FREQ)
. = clamp(frequency, MIN_FREE_FREQ, MAX_FREE_FREQ)
else
. = CLAMP(frequency, MIN_FREQ, MAX_FREQ)
. = clamp(frequency, MIN_FREQ, MAX_FREQ)
if(!(. % 2)) // Ensure the last digit is an odd number
. += 1

Expand Down
4 changes: 2 additions & 2 deletions code/__HELPERS/turfs.dm
Original file line number Diff line number Diff line change
Expand Up @@ -247,8 +247,8 @@ Turf and target are separate in case you want to teleport some distance from a t
tX = text2num(tX[2])
tZ = origin.z
var/list/actual_view = getviewsize(C ? C.view : world.view)
tX = CLAMP(origin.x + round(actual_view[1] / 2) - tX, 1, world.maxx)
tY = CLAMP(origin.y + round(actual_view[2] / 2) - tY, 1, world.maxy)
tX = clamp(origin.x + round(actual_view[1] / 2) - tX, 1, world.maxx)
tY = clamp(origin.y + round(actual_view[2] / 2) - tY, 1, world.maxy)
return locate(tX, tY, tZ)

///similar function to RANGE_TURFS(), but will search spiralling outwards from the center (like the above, but only turfs)
Expand Down
4 changes: 2 additions & 2 deletions code/_onclick/item_attack.dm
Original file line number Diff line number Diff line change
Expand Up @@ -157,9 +157,9 @@
/obj/item/proc/get_clamped_volume()
if(w_class)
if(force)
return CLAMP((force + w_class) * 4, 30, 100)// Add the item's force to its weight class and multiply by 4, then clamp the value between 30 and 100
return clamp((force + w_class) * 4, 30, 100)// Add the item's force to its weight class and multiply by 4, then clamp the value between 30 and 100
else
return CLAMP(w_class * 6, 10, 100) // Multiply the item's weight class by 6, then clamp the value between 10 and 100
return clamp(w_class * 6, 10, 100) // Multiply the item's weight class by 6, then clamp the value between 10 and 100

/mob/living/proc/send_item_attack_message(obj/item/I, mob/living/user, hit_area)
var/message_verb = "attacked"
Expand Down
2 changes: 1 addition & 1 deletion code/controllers/configuration/config_entry.dm
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@
return FALSE
var/temp = text2num(trim(str_val))
if(!isnull(temp))
config_entry_value = CLAMP(integer ? round(temp) : temp, min_val, max_val)
config_entry_value = clamp(integer ? round(temp) : temp, min_val, max_val)
if(config_entry_value != temp && !(datum_flags & DF_VAR_EDITED))
log_config("Changing [name] from [temp] to [config_entry_value]!")
return TRUE
Expand Down
2 changes: 1 addition & 1 deletion code/controllers/subsystem/processing/processing.dm
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ SUBSYSTEM_DEF(processing)
if (!resumed)
currentrun = processing.Copy()

var/continuous_delta_time = last_time_fired == 0 ? wait : (CLAMP(world.timeofday - last_time_fired, 0.5 * wait, 2 * wait))
var/continuous_delta_time = last_time_fired == 0 ? wait : (clamp(world.timeofday - last_time_fired, 0.5 * wait, 2 * wait))
last_time_fired = world.timeofday

//cache for sanic speed (lists are references anyways)
Expand Down
2 changes: 1 addition & 1 deletion code/controllers/subsystem/sound.dm
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@ SUBSYSTEM_DEF(sound_effects)
SSsound_effects.acting_effects[effect_id] = src

/datum/sound_effect/fade/update_effect()
var/time_multiplier = CLAMP((world.time - start_tick) / (end_tick - start_tick), 0, 1)
var/time_multiplier = clamp((world.time - start_tick) / (end_tick - start_tick), 0, 1)
current_vol = (time_multiplier * out_vol) + ((1-time_multiplier) * in_vol)
sound.status = SOUND_UPDATE
sound.volume = current_vol
Expand Down
4 changes: 2 additions & 2 deletions code/datums/components/butchering.dm
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@
var/item_force = source.force
if(!item_force) //Division by 0 protection
item_force = 1
if(do_after(user, CLAMP(500 / item_force, 30, 100), H) && H.Adjacent(source))
if(do_after(user, clamp(500 / item_force, 30, 100), H) && H.Adjacent(source))
if(H.has_status_effect(/datum/status_effect/neck_slice))
user.show_message("<span class='danger'>[H]'s neck has already been already cut, you can't make the bleeding any worse!", 1, \
"<span class='danger'>Their neck has already been already cut, you can't make the bleeding any worse!")
Expand All @@ -65,7 +65,7 @@
H.visible_message("<span class='danger'>[user] slits [H]'s throat!</span>", \
"<span class='userdanger'>[user] slits your throat...</span>")
H.apply_damage(item_force, BRUTE, BODY_ZONE_HEAD)
H.bleed_rate = CLAMP(H.bleed_rate + 20, 0, 30)
H.bleed_rate = clamp(H.bleed_rate + 20, 0, 30)
H.apply_status_effect(/datum/status_effect/neck_slice)

/datum/component/butchering/proc/Butcher(mob/living/butcher, mob/living/meat)
Expand Down
2 changes: 1 addition & 1 deletion code/datums/components/embedded.dm
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,7 @@
if(harmful && prob(pain_chance_current))
var/damage_left = max_damage - limb.get_damage()
var/damage_wanted = (1-pain_stam_pct) * damage
var/damage_to_deal = CLAMP(damage_wanted, 0, damage_left)
var/damage_to_deal = clamp(damage_wanted, 0, damage_left)
var/damage_as_stam = damage_wanted - damage_to_deal
if(!damage_to_deal)
to_chat(victim, "<span class='userdanger'>[weapon] embedded in your [limb.name] stings a little!</span>")
Expand Down
4 changes: 2 additions & 2 deletions code/datums/components/storage/storage.dm
Original file line number Diff line number Diff line change
Expand Up @@ -335,8 +335,8 @@
numbered_contents = _process_numerical_display()
adjusted_contents = numbered_contents.len

var/columns = CLAMP(max_items, 1, screen_max_columns)
var/rows = CLAMP(CEILING(adjusted_contents / columns, 1), 1, screen_max_rows)
var/columns = clamp(max_items, 1, screen_max_columns)
var/rows = clamp(CEILING(adjusted_contents / columns, 1), 1, screen_max_rows)
standard_orient_objs(rows, columns, numbered_contents)

//This proc draws out the inventory and places the items on it. It uses the standard position.
Expand Down
2 changes: 1 addition & 1 deletion code/datums/components/wet_floor.dm
Original file line number Diff line number Diff line change
Expand Up @@ -180,7 +180,7 @@
/datum/component/wet_floor/proc/_do_add_wet(type, duration_minimum, duration_add, duration_maximum)
var/time = 0
if(LAZYACCESS(time_left_list, "[type]"))
time = CLAMP(LAZYACCESS(time_left_list, "[type]") + duration_add, duration_minimum, duration_maximum)
time = clamp(LAZYACCESS(time_left_list, "[type]") + duration_add, duration_minimum, duration_maximum)
else
time = min(duration_minimum, duration_maximum)
LAZYSET(time_left_list, "[type]", time)
Expand Down
2 changes: 1 addition & 1 deletion code/datums/dash_weapon.dm
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@
to_chat(user, "<span class='warning'>You cannot dash here!</span>")

/datum/action/innate/dash/proc/charge()
current_charges = CLAMP(current_charges + 1, 0, max_charges)
current_charges = clamp(current_charges + 1, 0, max_charges)
owner.update_action_buttons_icon()
if(recharge_sound)
playsound(dashing_item, recharge_sound, 50, 1)
Expand Down
10 changes: 5 additions & 5 deletions code/datums/diseases/advance/advance.dm
Original file line number Diff line number Diff line change
Expand Up @@ -282,7 +282,7 @@

SetSpread()
permeability_mod = max(CEILING(0.4 * transmission, 1), 1)
cure_chance = 15 - CLAMP(resistance, -5, 5) // can be between 10 and 20
cure_chance = 15 - clamp(resistance, -5, 5) // can be between 10 and 20
stage_prob = max(stage_rate, 2)
SetDanger(severity)
GenerateCure()
Expand Down Expand Up @@ -357,7 +357,7 @@

// Will generate a random cure, the less resistance the symptoms have, the harder the cure.
/datum/disease/advance/proc/GenerateCure()
var/res = CLAMP(resistance - (symptoms.len / 2), 1, advance_cures.len)
var/res = clamp(resistance - (symptoms.len / 2), 1, advance_cures.len)
if(archivecure != res)
cures = list(pick(advance_cures[res]))
// Get the cure name from the cure_id
Expand Down Expand Up @@ -548,12 +548,12 @@
var/datum/disease/advance/A = make_copy ? Copy() : src
if(!initial && A.mutable && (spread_flags & DISEASE_SPREAD_CONTACT_FLUIDS))
var/minimum = 1
if(prob(CLAMP(35-(A.resistance + A.stealth - A.speed), 0, 50) * (A.mutability)))//stealthy/resistant diseases are less likely to mutate. this means diseases used to farm mutations should be easier to cure. hypothetically.
if(prob(clamp(35-(A.resistance + A.stealth - A.speed), 0, 50) * (A.mutability)))//stealthy/resistant diseases are less likely to mutate. this means diseases used to farm mutations should be easier to cure. hypothetically.
if(infectee.job == "clown" || infectee.job == "mime" || prob(1))//infecting a clown or mime can evolve l0 symptoms/. they can also appear very rarely
minimum = 0
else
minimum = CLAMP(A.severity - 1, 1, 7)
A.Evolve(minimum, CLAMP(A.severity + 4, minimum, 9))
minimum = clamp(A.severity - 1, 1, 7)
A.Evolve(minimum, clamp(A.severity + 4, minimum, 9))
A.id = GetDiseaseID()
A.keepid = TRUE//this is really janky, but basically mutated diseases count as the original disease
//if you want to evolve a higher level symptom you need to test and spread a deadly virus among test subjects.
Expand Down
2 changes: 1 addition & 1 deletion code/datums/diseases/advance/symptoms/alcohol.dm
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,6 @@
warningstrings = list("ahyguabngaghabyugbauwf", "You feel sick", "It feels like you drank too much", "You feel like doing something unwise")
else
warningstrings = list("You feel buzzed", "You feel a bit tipsy")
M.drunkenness = CLAMP(M.drunkenness + target * ((A.stage - 1) * 0.1), M.drunkenness, target)
M.drunkenness = clamp(M.drunkenness + target * ((A.stage - 1) * 0.1), M.drunkenness, target)
if(prob(5 * A.stage))
to_chat(M, "<span class='warning'>[pick(warningstrings)]</span>")
10 changes: 5 additions & 5 deletions code/datums/diseases/advance/symptoms/heal.dm
Original file line number Diff line number Diff line change
Expand Up @@ -502,7 +502,7 @@ im not even gonna bother with these for the following symptoms. typed em out, co
var/mob/living/carbon/M = A.affected_mob
ownermind = M.mind
if(!A.carrier && !A.dormant)
sizemult = CLAMP((0.5 + A.stage_rate / 10), 1.1, 1.5)
sizemult = clamp((0.5 + A.stage_rate / 10), 1.1, 1.5)
M.resize = sizemult
M.update_transform()

Expand Down Expand Up @@ -759,7 +759,7 @@ im not even gonna bother with these for the following symptoms. typed em out, co
var/excess = max(((min(amt, C.blood_volume) - (BLOOD_VOLUME_NORMAL - H.blood_volume)) / 4), 0)
H.blood_volume = min(H.blood_volume + min(amt, C.blood_volume), BLOOD_VOLUME_NORMAL)
C.blood_volume = max(C.blood_volume - amt, 0)
gainedpoints = CLAMP(excess, 0, maxbloodpoints - bloodpoints)
gainedpoints = clamp(excess, 0, maxbloodpoints - bloodpoints)
C.visible_message("<span class='warning'>Blood flows from [C.name]'s wounds into [H.name]!</span>", "<span class='userdanger'>Blood flows from your wounds into [H.name]!</span>")
playsound(C.loc, 'sound/magic/exit_blood.ogg', 25, 1)
return gainedpoints
Expand Down Expand Up @@ -793,7 +793,7 @@ im not even gonna bother with these for the following symptoms. typed em out, co
if(gainedpoints)
playsound(M.loc, 'sound/magic/exit_blood.ogg', 50, 1)
M.visible_message("<span class='warning'>Blood flows from the floor into [M.name]!</span>", "<span class='warning'>You consume the errant blood</span>")
return CLAMP(gainedpoints, 0, maxbloodpoints - bloodpoints)
return clamp(gainedpoints, 0, maxbloodpoints - bloodpoints)
if(ishuman(M) && aggression)//finally, attack mobs touching the host.
var/mob/living/carbon/human/H = M
for(var/mob/living/carbon/human/C in ohearers(1, H))
Expand All @@ -805,9 +805,9 @@ im not even gonna bother with these for the following symptoms. typed em out, co
var/excess = max(((min(amt, C.blood_volume) - (BLOOD_VOLUME_NORMAL - H.blood_volume)) / 4 * power), 0)
H.blood_volume = min(H.blood_volume + min(amt, C.blood_volume), BLOOD_VOLUME_NORMAL)
C.blood_volume = max(C.blood_volume - amt, 0)
gainedpoints += CLAMP(excess, 0, maxbloodpoints - bloodpoints)
gainedpoints += clamp(excess, 0, maxbloodpoints - bloodpoints)
C.visible_message("<span class='warning'>Blood flows from [C.name]'s wounds into [H.name]!</span>", "<span class='userdanger'>Blood flows from your wounds into [H.name]!</span>")
return CLAMP(gainedpoints, 0, maxbloodpoints - bloodpoints)
return clamp(gainedpoints, 0, maxbloodpoints - bloodpoints)


/datum/symptom/parasite
Expand Down
6 changes: 3 additions & 3 deletions code/datums/elements/mirage_border.dm
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,9 @@
if(istext(range))
range = max(getviewsize(range)[1], getviewsize(range)[2])

var/z = CLAMP(target_turf.z, 1, world.maxz)
var/turf/southwest = locate(CLAMP(x - (direction & WEST ? range : 0), 1, world.maxx), CLAMP(y - (direction & SOUTH ? range : 0), 1, world.maxy), z)
var/turf/northeast = locate(CLAMP(x + (direction & EAST ? range : 0), 1, world.maxx), CLAMP(y + (direction & NORTH ? range : 0), 1, world.maxy), z)
var/z = clamp(target_turf.z, 1, world.maxz)
var/turf/southwest = locate(clamp(x - (direction & WEST ? range : 0), 1, world.maxx), clamp(y - (direction & SOUTH ? range : 0), 1, world.maxy), z)
var/turf/northeast = locate(clamp(x + (direction & EAST ? range : 0), 1, world.maxx), clamp(y + (direction & NORTH ? range : 0), 1, world.maxy), z)
holder.vis_contents += block(southwest, northeast)
if(direction & SOUTH)
holder.pixel_y -= world.icon_size * range
Expand Down
4 changes: 2 additions & 2 deletions code/datums/martial/krav_maga.dm
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@
"<span class='userdanger'>[A] slams your chest! You can't breathe!</span>", null, COMBAT_MESSAGE_RANGE)
playsound(get_turf(A), 'sound/effects/hit_punch.ogg', 50, 1, -1)
if(D.losebreath <= 10)
D.losebreath = CLAMP(D.losebreath + 5, 0, 10)
D.losebreath = clamp(D.losebreath + 5, 0, 10)
D.adjustOxyLoss(10)
log_combat(A, D, "quickchoked")
return 1
Expand All @@ -116,7 +116,7 @@
playsound(get_turf(A), 'sound/effects/hit_punch.ogg', 50, 1, -1)
D.apply_damage(5, A.dna.species.attack_type)
if(D.silent <= 10)
D.silent = CLAMP(D.silent + 10, 0, 10)
D.silent = clamp(D.silent + 10, 0, 10)
log_combat(A, D, "neck chopped")
return 1

Expand Down
4 changes: 2 additions & 2 deletions code/datums/martial/tribal_claw.dm
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ Deals 15 brute to head(reduced by armor) and causes a rapid bleeding effect simi
D.visible_message("<span class='warning'>[A] cuts [D]'s jugular vein with their claws!</span>", \
"<span class='userdanger'>[A] cuts your jugular vein!</span>")
D.apply_damage(15, BRUTE, BODY_ZONE_HEAD, def_check)
D.bleed_rate = CLAMP(D.bleed_rate + 20, 0, 30)
D.bleed_rate = clamp(D.bleed_rate + 20, 0, 30)
D.apply_status_effect(/datum/status_effect/neck_slice)
A.do_attack_animation(D, ATTACK_EFFECT_CLAW)
playsound(get_turf(D), 'sound/weapons/slash.ogg', 50, 1, -1)
Expand All @@ -77,7 +77,7 @@ Deals 15 brute to head(reduced by armor) and causes a rapid bleeding effect simi
D.Knockdown(5) //Without knockdown target still stands up while T3 grabbed.
A.setGrabState(GRAB_NECK)
if(D.silent <= 10)
D.silent = CLAMP(D.silent + 10, 0, 10)
D.silent = clamp(D.silent + 10, 0, 10)

/datum/martial_art/tribal_claw/harm_act(mob/living/carbon/human/A, mob/living/carbon/human/D)
add_to_streak("H",D)
Expand Down
2 changes: 1 addition & 1 deletion code/datums/progressbar.dm
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@
if (user.client)
user.client.images += bar

progress = CLAMP(progress, 0, goal)
progress = clamp(progress, 0, goal)
last_progress = progress
bar.icon_state = "prog_bar_[round(((progress / goal) * 100), 5)]"
if (!shown)
Expand Down
4 changes: 2 additions & 2 deletions code/game/gamemodes/dynamic/dynamic_rulesets_roundstart.dm
Original file line number Diff line number Diff line change
Expand Up @@ -558,7 +558,7 @@
if (prob(meteorminutes/2))
wavetype = GLOB.meteors_catastrophic

var/ramp_up_final = CLAMP(round(meteorminutes/rampupdelta), 1, 10)
var/ramp_up_final = clamp(round(meteorminutes/rampupdelta), 1, 10)

spawn_meteors(ramp_up_final, wavetype)

Expand Down Expand Up @@ -649,7 +649,7 @@
var/datum/team/incursion/incursion_team

/datum/dynamic_ruleset/roundstart/incursion/ready(population, forced = FALSE)
required_candidates = CLAMP(get_antag_cap(population), CONFIG_GET(number/incursion_count_min), CONFIG_GET(number/incursion_count_max))
required_candidates = clamp(get_antag_cap(population), CONFIG_GET(number/incursion_count_min), CONFIG_GET(number/incursion_count_max))
return ..()

/datum/dynamic_ruleset/roundstart/incursion/pre_execute(population)
Expand Down
2 changes: 1 addition & 1 deletion code/game/gamemodes/incursion/incursion.dm
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@
var/pop = GLOB.player_details.len
var/team_size = (2 * pop) / ((2 * cost_base) + ((pop - 1) * cost_increment))
log_game("Spawning [team_size] incursionists.")
team_size = CLAMP(team_size, CONFIG_GET(number/incursion_count_min), CONFIG_GET(number/incursion_count_max))
team_size = clamp(team_size, CONFIG_GET(number/incursion_count_min), CONFIG_GET(number/incursion_count_max))

for(var/k = 1 to team_size)
var/datum/mind/incursion = antag_pick(antag_candidates, /datum/role_preference/antagonist/incursionist)
Expand Down
2 changes: 1 addition & 1 deletion code/game/gamemodes/meteor/meteor.dm
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
if (prob(meteorminutes/2))
wavetype = GLOB.meteors_catastrophic

var/ramp_up_final = CLAMP(round(meteorminutes/rampupdelta), 1, 10)
var/ramp_up_final = clamp(round(meteorminutes/rampupdelta), 1, 10)

spawn_meteors(ramp_up_final, wavetype)

Expand Down
8 changes: 4 additions & 4 deletions code/game/machinery/airlock_cycle_control.dm
Original file line number Diff line number Diff line change
Expand Up @@ -742,16 +742,16 @@
scan()
. = TRUE
if("interior_pressure")
interior_pressure = CLAMP(text2num(params["pressure"]), 0, ONE_ATMOSPHERE)
interior_pressure = clamp(text2num(params["pressure"]), 0, ONE_ATMOSPHERE)
. = TRUE
if("exterior_pressure")
exterior_pressure = CLAMP(text2num(params["pressure"]), 0, ONE_ATMOSPHERE)
exterior_pressure = clamp(text2num(params["pressure"]), 0, ONE_ATMOSPHERE)
. = TRUE
if("depressurization_margin")
depressurization_margin = CLAMP(text2num(params["pressure"]), 0.15, 40)
depressurization_margin = clamp(text2num(params["pressure"]), 0.15, 40)
. = TRUE
if("skip_delay")
skip_delay = CLAMP(text2num(params["skip_delay"]), 0, 1200)
skip_delay = clamp(text2num(params["skip_delay"]), 0, 1200)
. = TRUE

if(.)
Expand Down
4 changes: 2 additions & 2 deletions code/game/machinery/computer/apc_control.dm
Original file line number Diff line number Diff line change
Expand Up @@ -151,7 +151,7 @@
return
log_activity("changed greater than charge filter to \"[new_filter]\"")
if(new_filter)
new_filter = CLAMP(new_filter, 0, 100)
new_filter = clamp(new_filter, 0, 100)
playsound(src, 'sound/machines/terminal_prompt_confirm.ogg', 50, 0)
result_filters["Charge Above"] = new_filter
if(href_list["below_filter"])
Expand All @@ -161,7 +161,7 @@
return
log_activity("changed lesser than charge filter to \"[new_filter]\"")
if(new_filter)
new_filter = CLAMP(new_filter, 0, 100)
new_filter = clamp(new_filter, 0, 100)
playsound(src, 'sound/machines/terminal_prompt_confirm.ogg', 50, 0)
result_filters["Charge Below"] = new_filter
if(href_list["access_filter"])
Expand Down
4 changes: 2 additions & 2 deletions code/game/machinery/computer/security.dm
Original file line number Diff line number Diff line change
Expand Up @@ -590,7 +590,7 @@ What a mess.*/
default_description += "[c.crimeDetails]\n"

var/headerText = stripped_input(usr, "Please enter Poster Heading (Max 7 Chars):", "Print Wanted Poster", "WANTED", 8)
var/posternum = CLAMP((input("Number of posters to print (Max 5):","Number:",1) as num|null), 1, 5)
var/posternum = clamp((input("Number of posters to print (Max 5):","Number:",1) as num|null), 1, 5)
var/info = stripped_multiline_input(usr, "Please input a description for the poster:", "Print Wanted Poster", default_description, null)
if(info)
printing = 1
Expand All @@ -609,7 +609,7 @@ What a mess.*/
var/default_description = "A poster declaring [missing_name] to be a missing individual, missed by Nanotrasen. Report any sightings to security immediately."

var/headerText = stripped_input(usr, "Please enter Poster Heading (Max 7 Chars):", "Print Missing Persons Poster", "MISSING", 8)
var/posternum = CLAMP((input("Number of posters to print (Max 5):","Number:",1) as num|null), 1, 5)
var/posternum = clamp((input("Number of posters to print (Max 5):","Number:",1) as num|null), 1, 5)
var/info = stripped_multiline_input(usr, "Please input a description for the poster:", "Print Missing Persons Poster", default_description, null)
if(info)
printing = 1
Expand Down
Loading

0 comments on commit 05f763f

Please sign in to comment.