14 lines
329 B
Markdown
14 lines
329 B
Markdown
# chroma_trail.js — clampLife() (satır 170)
|
||
|
||
[← chroma_trail.js](index.md) · [← Master](../../wiki.md)
|
||
|
||
```javascript
|
||
function clampLife(v) {
|
||
v = Math.round(Number(v));
|
||
if (!isFinite(v)) v = DEFAULT_LIFE;
|
||
if (v < MIN_LIFE) v = MIN_LIFE;
|
||
if (v > MAX_LIFE) v = MAX_LIFE;
|
||
return v;
|
||
}
|
||
```
|