2
0
mirror of https://github.com/rehlds/reapi.git synced 2024-12-27 07:05:28 +03:00

Fixes #134 rh_get_mapname fixed incorrectly get length argument

This commit is contained in:
s1lent 2019-06-24 00:44:41 +07:00
parent c00ded59a2
commit ec11f8ad93
No known key found for this signature in database
GPG Key ID: 0FE401DC73916B5C

View File

@ -2270,18 +2270,17 @@ enum MapNameType { MNT_TRUE, MNT_SET };
*/
cell AMX_NATIVE_CALL rh_get_mapname(AMX *amx, cell *params)
{
enum args_e { arg_count, arg_output, arg_len, arg_type };
enum args_e { arg_count, arg_output, arg_maxlen, arg_type };
cell* dest = getAmxAddr(amx, params[arg_output]);
size_t length = *getAmxAddr(amx, params[arg_len]);
switch ((MapNameType)params[arg_type])
{
case MNT_TRUE:
setAmxString(dest, g_szMapName, length);
setAmxString(dest, g_szMapName, params[arg_maxlen]);
break;
case MNT_SET:
setAmxString(dest, g_RehldsData->GetName(), length);
setAmxString(dest, g_RehldsData->GetName(), params[arg_maxlen]);
break;
}