diff --git a/plugins/include/console.inc b/plugins/include/console.inc index 120a42eb..8b07d6fb 100644 --- a/plugins/include/console.inc +++ b/plugins/include/console.inc @@ -33,7 +33,7 @@ enum ConVarBounds enum QueryCookie { QUERYCOOKIE_FAILED = 0, -} +}; /** * Console variable query result values. diff --git a/plugins/include/core.inc b/plugins/include/core.inc index 6cc01675..5fd5634a 100644 --- a/plugins/include/core.inc +++ b/plugins/include/core.inc @@ -43,7 +43,7 @@ enum Action Plugin_Continue = 0, /**< Continue with the original action */ Plugin_Handled = 3, /**< Handle the action at the end (don't call it) */ Plugin_Stop = 4, /**< Immediately stop the hook chain and handle the original */ -} +}; public PlVers:__version = { diff --git a/plugins/include/float.inc b/plugins/include/float.inc index 4b302a37..9914220f 100644 --- a/plugins/include/float.inc +++ b/plugins/include/float.inc @@ -212,83 +212,135 @@ native Float:operator+(Float:oper1, Float:oper2) = FloatAdd; native Float:operator-(Float:oper1, Float:oper2) = FloatSub; stock Float:operator++(Float:oper) +{ return oper+1.0; +} stock Float:operator--(Float:oper) +{ return oper-1.0; +} stock Float:operator-(Float:oper) +{ return oper^Float:((-1)^((-1)/2)); /* IEEE values are sign/magnitude */ +} stock Float:operator*(Float:oper1, oper2) +{ return FloatMul(oper1, float(oper2)); /* "*" is commutative */ +} stock Float:operator/(Float:oper1, oper2) +{ return FloatDiv(oper1, float(oper2)); +} stock Float:operator/(oper1, Float:oper2) +{ return FloatDiv(float(oper1), oper2); +} stock Float:operator+(Float:oper1, oper2) +{ return FloatAdd(oper1, float(oper2)); /* "+" is commutative */ +} stock Float:operator-(Float:oper1, oper2) +{ return FloatSub(oper1, float(oper2)); +} stock Float:operator-(oper1, Float:oper2) +{ return FloatSub(float(oper1), oper2); +} stock bool:operator==(Float:oper1, Float:oper2) +{ return FloatCompare(oper1, oper2) == 0; +} stock bool:operator==(Float:oper1, oper2) +{ return FloatCompare(oper1, float(oper2)) == 0; /* "==" is commutative */ +} stock bool:operator!=(Float:oper1, Float:oper2) +{ return FloatCompare(oper1, oper2) != 0; +} stock bool:operator!=(Float:oper1, oper2) +{ return FloatCompare(oper1, float(oper2)) != 0; /* "==" is commutative */ +} stock bool:operator>(Float:oper1, Float:oper2) +{ return FloatCompare(oper1, oper2) > 0; +} stock bool:operator>(Float:oper1, oper2) +{ return FloatCompare(oper1, float(oper2)) > 0; +} stock bool:operator>(oper1, Float:oper2) +{ return FloatCompare(float(oper1), oper2) > 0; +} stock bool:operator>=(Float:oper1, Float:oper2) +{ return FloatCompare(oper1, oper2) >= 0; +} stock bool:operator>=(Float:oper1, oper2) +{ return FloatCompare(oper1, float(oper2)) >= 0; +} stock bool:operator>=(oper1, Float:oper2) +{ return FloatCompare(float(oper1), oper2) >= 0; +} stock bool:operator<(Float:oper1, Float:oper2) +{ return FloatCompare(oper1, oper2) < 0; +} stock bool:operator<(Float:oper1, oper2) +{ return FloatCompare(oper1, float(oper2)) < 0; +} stock bool:operator<(oper1, Float:oper2) +{ return FloatCompare(float(oper1), oper2) < 0; +} stock bool:operator<=(Float:oper1, Float:oper2) +{ return FloatCompare(oper1, oper2) <= 0; +} stock bool:operator<=(Float:oper1, oper2) +{ return FloatCompare(oper1, float(oper2)) <= 0; +} stock bool:operator<=(oper1, Float:oper2) +{ return FloatCompare(float(oper1), oper2) <= 0; +} stock bool:operator!(Float:oper) +{ return (_:oper & ((-1)/2)) == 0; /* -1 = all bits to 1; /2 = remove most significant bit (sign) works on both 32bit and 64bit systems; no constant required */ +} /** * Forbidden operators. diff --git a/plugins/include/functions.inc b/plugins/include/functions.inc index aa42c3c8..d7b6eeab 100644 --- a/plugins/include/functions.inc +++ b/plugins/include/functions.inc @@ -211,7 +211,7 @@ native Call_StartFunction(Handle:plugin, Function:func); * @noreturn * @error Called before a call has been started. */ -native Call_PushCell({Handle,Function,_}:value); +native Call_PushCell(any:value); /** * Pushes a cell by reference onto the current call. @@ -222,7 +222,7 @@ native Call_PushCell({Handle,Function,_}:value); * @noreturn * @error Called before a call has been started. */ -native Call_PushCellRef(&{Handle,Function,_}:value); +native Call_PushCellRef(&any:value); /** @@ -258,7 +258,7 @@ native Call_PushFloatRef(&Float:value); * @noreturn * @error Called before a call has been started. */ -native Call_PushArray(const {Handle,Float,Function,_}:value[], size); +native Call_PushArray(const any:value[], size); /** * Pushes an array onto the current call. @@ -272,7 +272,7 @@ native Call_PushArray(const {Handle,Float,Function,_}:value[], size); * @noreturn * @error Called before a call has been started. */ -native Call_PushArrayEx({Handle,Float,Function,_}:value[], size, cpflags); +native Call_PushArrayEx(any:value[], size, cpflags); /** * Pushes a string onto the current call. @@ -420,7 +420,7 @@ native GetNativeCellRef(param); * @noreturn * @error Invalid parameter number or calling from a non-native function. */ -native SetNativeCellRef(param, {Float,Function,Handle,_}:value); +native SetNativeCellRef(param, any:value); /** * Gets an array from a native parameter (always by reference). @@ -431,7 +431,7 @@ native SetNativeCellRef(param, {Float,Function,Handle,_}:value); * @return SP_ERROR_NONE on success, anything else on failure. * @error Invalid parameter number or calling from a non-native function. */ -native GetNativeArray(param, {Float,Function,Handle,_}:local[], size); +native GetNativeArray(param, any:local[], size); /** * Copies a local array into a native parameter array (always by reference). @@ -442,7 +442,7 @@ native GetNativeArray(param, {Float,Function,Handle,_}:local[], size); * @return SP_ERROR_NONE on success, anything else on failure. * @error Invalid parameter number or calling from a non-native function. */ -native SetNativeArray(param, const {Float,Function,Handle,_}:local[], size); +native SetNativeArray(param, const any:local[], size); /** * Formats a string using parameters from a native.