mirror of
https://github.com/PolarisSS13/Polaris.git
synced 2026-07-20 12:42:43 +01:00
between() -> clamp() & swaps args 1 and 2 in uses
This commit is contained in:
@@ -153,7 +153,7 @@ var/global/datum/ntnet/ntnet_global = new()
|
||||
if(!lognumber)
|
||||
return 0
|
||||
// Trim the value if necessary
|
||||
lognumber = between(MIN_NTNET_LOGS, lognumber, MAX_NTNET_LOGS)
|
||||
lognumber = clamp(lognumber, MIN_NTNET_LOGS, MAX_NTNET_LOGS)
|
||||
setting_maxlogcount = lognumber
|
||||
add_log("Configuration Updated. Now keeping [setting_maxlogcount] logs in system memory.")
|
||||
|
||||
@@ -185,4 +185,3 @@ var/global/datum/ntnet/ntnet_global = new()
|
||||
for(var/datum/ntnet_conversation/chan in chat_channels)
|
||||
if(chan.id == id)
|
||||
return chan
|
||||
|
||||
|
||||
@@ -23,7 +23,7 @@
|
||||
amount = round(amount)
|
||||
if(damage_casing)
|
||||
damage += amount
|
||||
damage = between(0, damage, max_damage)
|
||||
damage = clamp(damage, 0, max_damage)
|
||||
|
||||
if(component_probability)
|
||||
for(var/obj/item/computer_hardware/H in get_all_components())
|
||||
|
||||
@@ -84,4 +84,4 @@
|
||||
// Damages the component. Contains necessary checks. Negative damage "heals" the component.
|
||||
/obj/item/computer_hardware/take_damage(var/amount)
|
||||
damage += round(amount) // We want nice rounded numbers here.
|
||||
damage = between(0, damage, max_damage) // Clamp the value.
|
||||
damage = clamp(damage, 0, max_damage) // Clamp the value.
|
||||
|
||||
Reference in New Issue
Block a user