Rename lerp() for 516 support (#37461)

This commit is contained in:
ike709
2025-03-06 06:50:25 -06:00
committed by GitHub
parent 86f8a64c6c
commit f6eef85877
3 changed files with 4 additions and 4 deletions

View File

@@ -146,7 +146,7 @@ var/ZAS_fuel_energy_release_rate = zas_settings.Get(/datum/ZAS_Setting/fire_fuel
/atom/proc/genSmoke(var/oxy,var/temp,var/turf/where,var/force_smoke = FALSE) /atom/proc/genSmoke(var/oxy,var/temp,var/turf/where,var/force_smoke = FALSE)
if(!force_smoke) if(!force_smoke)
if(prob(clamp(lerp(temp,T20C,T0C + 1000,96,100),96,100))) //4% chance of smoke at 20C, 0% at 1000C if(prob(clamp(lerp_generic(temp,T20C,T0C + 1000,96,100),96,100))) //4% chance of smoke at 20C, 0% at 1000C
return FALSE return FALSE
var/smoke_density = clamp(5 * ((MINOXY2BURN/oxy) ** 2),1,5) var/smoke_density = clamp(5 * ((MINOXY2BURN/oxy) ** 2),1,5)
var/datum/effect/system/smoke_spread/bad/smoke = new var/datum/effect/system/smoke_spread/bad/smoke = new

View File

@@ -112,7 +112,7 @@ var/const/Sqrt2 = 1.41421356
/** /**
* Generic lerp function. * Generic lerp function.
*/ */
/proc/lerp(x, x0, x1, y0 = 0, y1 = 1) /proc/lerp_generic(x, x0, x1, y0 = 0, y1 = 1)
return y0 + (y1 - y0)*(x - x0)/(x1 - x0) return y0 + (y1 - y0)*(x - x0)/(x1 - x0)
/** /**
@@ -141,7 +141,7 @@ var/const/Sqrt2 = 1.41421356
* This is the counterpart to the mix() function. It returns the actual * This is the counterpart to the mix() function. It returns the actual
* percentage x is at inside the [a, b] range. * percentage x is at inside the [a, b] range.
* *
* Note that this is theoretically equivalent to calling lerp(x, a, b) * Note that this is theoretically equivalent to calling lerp_generic(x, a, b)
* (y0 and y1 default to 0 and 1) but this one is slightly faster * (y0 and y1 default to 0 and 1) but this one is slightly faster
* because Byond is too dumb to optimize procs with default values. It * because Byond is too dumb to optimize procs with default values. It
* shouldn't matter which one you use (since there are no FP issues) * shouldn't matter which one you use (since there are no FP issues)

View File

@@ -473,7 +473,7 @@ var/global/list/reagents_to_always_log = list(AMUTATIONTOXIN, CYANIDE, CHEFSPECI
if(!smoking) if(!smoking)
add_particles(PS_SMOKE) add_particles(PS_SMOKE)
smoking = TRUE smoking = TRUE
var/rate = clamp(lerp(G.temperature,autoignition_temperature * 0.75,autoignition_temperature,0.1,1),0.1,1) var/rate = clamp(lerp_generic(G.temperature,autoignition_temperature * 0.75,autoignition_temperature,0.1,1),0.1,1)
adjust_particles(PVAR_SPAWNING,rate,PS_SMOKE) adjust_particles(PVAR_SPAWNING,rate,PS_SMOKE)
sleep(10 SECONDS) sleep(10 SECONDS)
G = return_air() G = return_air()