From 9997c31703fae31672557f7b24627e89b4d8156d Mon Sep 17 00:00:00 2001 From: Arkshine Date: Fri, 9 Oct 2015 20:30:45 +0200 Subject: [PATCH] Fix (get/set)_pdata_(int/float) using the wrong offset value (typo from #297) --- modules/fakemeta/pdata.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/modules/fakemeta/pdata.cpp b/modules/fakemeta/pdata.cpp index ffbe74dc..b69dfbe0 100644 --- a/modules/fakemeta/pdata.cpp +++ b/modules/fakemeta/pdata.cpp @@ -58,7 +58,7 @@ static cell AMX_NATIVE_CALL set_pdata_int(AMX *amx, cell *params) iOffset += params[5]; #endif int iValue=params[3]; - set_pdata(TypeConversion.id_to_edict(index), iOffset, iValue); + set_pdata(TypeConversion.id_to_edict(index), iOffset * 4, iValue); // *4 because macro is char-based, while native is int-based return 1; } @@ -80,7 +80,7 @@ static cell AMX_NATIVE_CALL get_pdata_int(AMX *amx, cell *params) iOffset += params[4]; #endif - return get_pdata(TypeConversion.id_to_edict(index), iOffset); + return get_pdata(TypeConversion.id_to_edict(index), iOffset * 4); // *4 because macro is char-based, while native is int-based } // Float @@ -103,7 +103,7 @@ static cell AMX_NATIVE_CALL set_pdata_float(AMX *amx, cell *params) #endif float fValue=amx_ctof(params[3]); - set_pdata(TypeConversion.id_to_edict(index), iOffset, fValue); + set_pdata(TypeConversion.id_to_edict(index), iOffset * 4, fValue); // *4 because macro is char-based, while native is int-based return 1; } static cell AMX_NATIVE_CALL get_pdata_float(AMX *amx, cell *params) @@ -124,7 +124,7 @@ static cell AMX_NATIVE_CALL get_pdata_float(AMX *amx, cell *params) iOffset += params[4]; #endif - return amx_ftoc(get_pdata(TypeConversion.id_to_edict(index), iOffset)); + return amx_ftoc(get_pdata(TypeConversion.id_to_edict(index), iOffset * 4)); // *4 because macro is char-based, while native is int-based } static cell AMX_NATIVE_CALL get_pdata_string(AMX *amx, cell *params)