From 9d4c02f7cad72e3d59638515f32e11ee53741457 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Valentin=20Gr=C3=BCnbacher?= Date: Sun, 15 Mar 2015 22:56:31 +0100 Subject: [PATCH] Nuke IsPackReadable This native exposes/requires knowledge about implementation details of the internal DataPack structure. Plugins can not properly deal with this, and abusing this functionality results in a chance of future breakage. --- amxmodx/datapacks.cpp | 14 -------------- 1 file changed, 14 deletions(-) diff --git a/amxmodx/datapacks.cpp b/amxmodx/datapacks.cpp index c886ae02..7e1de2e6 100644 --- a/amxmodx/datapacks.cpp +++ b/amxmodx/datapacks.cpp @@ -197,19 +197,6 @@ static cell AMX_NATIVE_CALL SetPackPosition(AMX* amx, cell* params) return 1; } -static cell AMX_NATIVE_CALL IsPackReadable(AMX* amx, cell* params) -{ - CDataPack *d = g_DataPackHandles.lookup(params[1]); - - if (d == NULL) - { - LogError(amx, AMX_ERR_NATIVE, "Invalid datapack handle provided (%d)", params[1]); - return 0; - } - - return d->IsReadable(params[2]) ? 1 : 0; -} - static cell AMX_NATIVE_CALL DestroyDataPack(AMX* amx, cell* params) { cell *ptr = get_amxaddr(amx, params[1]); @@ -243,7 +230,6 @@ AMX_NATIVE_INFO g_DatapackNatives[] = { "ResetPack", ResetPack }, { "GetPackPosition", GetPackPosition }, { "SetPackPosition", SetPackPosition }, - { "IsPackReadable", IsPackReadable }, { "DestroyDataPack", DestroyDataPack }, {NULL, NULL} };