Added api documentation for Clamp()
This commit is contained in:
parent
a92cff20ea
commit
43de9af878
@ -2762,6 +2762,7 @@ end
|
||||
AddFaceDirection = {Params = "BlockX, BlockY, BlockZ, BlockFace, [IsInverse]", Return = "BlockX, BlockY, BlockZ", Notes = "Returns the coords of a block adjacent to the specified block through the specified {{Globals#BlockFaces|face}}"},
|
||||
BlockFaceToString = {Params = "{{Globals#BlockFaces|eBlockFace}}", Return = "string", Notes = "Returns the string representation of the {{Globals#BlockFaces|eBlockFace}} constant. Uses the axis-direction-based names, such as BLOCK_FACE_XP." },
|
||||
BlockStringToType = {Params = "BlockTypeString", Return = "BLOCKTYPE", Notes = "Returns the block type parsed from the given string"},
|
||||
Clamp = {Params = "Number, Min, Max", Return = "number", Notes = "Clamp the number to the specified range."},
|
||||
ClickActionToString = {Params = "{{Globals#ClickAction|ClickAction}}", Return = "string", Notes = "Returns a string description of the ClickAction enumerated value"},
|
||||
DamageTypeToString = {Params = "{{Globals#DamageType|DamageType}}", Return = "string", Notes = "Converts the {{Globals#DamageType|DamageType}} enumerated value to a string representation "},
|
||||
EscapeString = {Params = "string", Return = "string", Notes = "Returns a copy of the string with all quotes and backslashes escaped by a backslash"},
|
||||
|
@ -96,8 +96,8 @@ static int tolua_Clamp(lua_State * tolua_S)
|
||||
return lua_do_error(LuaState, "Error in function call '#funcname#': Expected a number for parameters #1, #2 and #3");
|
||||
}
|
||||
|
||||
int Min = (int)tolua_tonumber(LuaState, 1, 0);
|
||||
int Number = (int)tolua_tonumber(LuaState, 2, 0);
|
||||
int Number = (int)tolua_tonumber(LuaState, 1, 0);
|
||||
int Min = (int)tolua_tonumber(LuaState, 2, 0);
|
||||
int Max = (int)tolua_tonumber(LuaState, 3, 0);
|
||||
|
||||
int Result = std::min(std::max(Min, Number), Max);
|
||||
|
Loading…
Reference in New Issue
Block a user