From 15904761e8685f8a68bf99583c4839f7a5223ea7 Mon Sep 17 00:00:00 2001 From: David Anderson Date: Wed, 24 Mar 2004 00:54:35 +0000 Subject: [PATCH] compiles now --- dlls/engine/meta_api.cpp | 19 +++++++++++++++++-- 1 file changed, 17 insertions(+), 2 deletions(-) diff --git a/dlls/engine/meta_api.cpp b/dlls/engine/meta_api.cpp index f95dab4d..d68ca549 100755 --- a/dlls/engine/meta_api.cpp +++ b/dlls/engine/meta_api.cpp @@ -380,6 +380,11 @@ static cell AMX_NATIVE_CALL set_offset_short(AMX *amx, cell *params) AMX_RAISEERROR(amx, AMX_ERR_NATIVE); return 0; } + + if (!is_PlayerOn[index]) { + AMX_RAISEERROR(amx, AMX_ERR_NATIVE); + return 0; + } edict_t *pEnt = INDEXENT(index); @@ -403,6 +408,11 @@ static cell AMX_NATIVE_CALL set_offset(AMX *amx, cell *params) AMX_RAISEERROR(amx, AMX_ERR_NATIVE); return 0; } + + if (!is_PlayerOn[index]) { + AMX_RAISEERROR(amx, AMX_ERR_NATIVE); + return 0; + } edict_t *pEnt = INDEXENT(index); @@ -428,6 +438,11 @@ static cell AMX_NATIVE_CALL set_offset_float(AMX *amx, cell *params) AMX_RAISEERROR(amx, AMX_ERR_NATIVE); return 0; } + + if (!is_PlayerOn[index]) { + AMX_RAISEERROR(amx, AMX_ERR_NATIVE); + return 0; + } edict_t *pEnt = INDEXENT(index); @@ -435,7 +450,7 @@ static cell AMX_NATIVE_CALL set_offset_float(AMX *amx, cell *params) off -= 5; #endif - *((float *)Player->pvPrivateData + off) = fNewValue; + *((float *)pEnt->pvPrivateData + off) = fNewValue; return 1; } @@ -501,7 +516,7 @@ static cell AMX_NATIVE_CALL get_offset_float(AMX *amx, cell *params) { int index = params[1]; int off = params[2]; - //float retVal; + float retVal; if (index < 1 || index > gpGlobals->maxEntities) { AMX_RAISEERROR(amx, AMX_ERR_NATIVE);