between() -> clamp() & swaps args 1 and 2 in uses

This commit is contained in:
Spookerton
2024-01-31 13:34:02 +00:00
parent dfac4a77fe
commit ebbf0e33fb
68 changed files with 137 additions and 146 deletions
@@ -180,7 +180,7 @@
if(attached_grenade && !attached_grenade.active)
var/datum/integrated_io/detonation_time = inputs[1]
if(isnum(detonation_time.data) && detonation_time.data > 0)
attached_grenade.det_time = between(1, detonation_time.data, 12) SECONDS
attached_grenade.det_time = clamp(detonation_time.data, 1, 12) SECONDS
attached_grenade.activate()
var/atom/holder = loc
log_and_message_admins("activated a grenade assembly. Last touches: Assembly: [holder.fingerprintslast] Circuit: [fingerprintslast] Grenade: [attached_grenade.fingerprintslast]")
@@ -203,4 +203,4 @@
/obj/item/integrated_circuit/manipulation/grenade/frag
pre_attached_grenade_type = /obj/item/grenade/explosive
origin_tech = list(TECH_ENGINEERING = 3, TECH_DATA = 3, TECH_COMBAT = 10)
spawn_flags = null // Used for world initializing, see the #defines above.
spawn_flags = null // Used for world initializing, see the #defines above.
@@ -196,7 +196,7 @@
var/selected_sound = sounds[ID]
if(!selected_sound)
return
vol = between(0, vol, 100)
vol = clamp(vol, 0, 100)
playsound(src, selected_sound, vol, freq, -1)
/obj/item/integrated_circuit/output/sound/beeper
@@ -449,7 +449,7 @@
if(!isnum(holo_scale) || !isnum(holo_rotation) )
return FALSE // Invalid.
hologram.adjust_scale(between(-2, holo_scale, 2) )
hologram.adjust_scale(clamp(holo_scale, -2, 2))
hologram.adjust_rotation(holo_rotation)
update_hologram_position()
@@ -462,8 +462,8 @@
if(!isnum(holo_x) || !isnum(holo_y) )
return FALSE
holo_x = between(-7, holo_x, 7)
holo_y = between(-7, holo_y, 7)
holo_x = clamp(holo_x, -7, 7)
holo_y = clamp(holo_y, -7, 7)
var/turf/T = get_turf(src)
if(T)