If all three arguments to clamp() are constants, the server hits an illegal operation at runtime.
Numbered Steps to Reproduce Problem:
1. Call clamp() with all three arguments as constants (either literals or const vars)
Code Snippet (if applicable) to Reproduce Problem:
/world/New()
world.log << clamp(1, 2, 3)
Expected Results:
In the above case, 2
Actual Results:
BUG: Crashing due to an illegal operation!
Does the problem occur:
Every time? Or how often?
Every time.
When does the problem NOT occur?
When at least one of the args is not a constant.
Did the problem NOT occur in any earlier versions? If so, what was the last version that worked? (Visit http://www.byond.com/download/build to download old versions for testing.)
Not tested, but it presumably has done this since clamp() was added.
Workarounds:
Don't do this. It's not useful anyway, since you could just replace it with the number you want.