From 82d5b423565072a091b1012831c9dbd846b86a32 Mon Sep 17 00:00:00 2001 From: Pavol Marko Date: Thu, 22 Jul 2004 14:55:16 +0000 Subject: [PATCH] added handlers for 3 new error messages from CAmxxReader --- amxmodx/modules.cpp | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/amxmodx/modules.cpp b/amxmodx/modules.cpp index 8cbc06ec..e3da1be1 100755 --- a/amxmodx/modules.cpp +++ b/amxmodx/modules.cpp @@ -132,7 +132,7 @@ int load_amxscript(AMX *amx, void **program, const char *filename, char error[64 */ *error = 0; - CAmxxReader reader(filename, SMALL_CELL_SIZE); + CAmxxReader reader(filename, SMALL_CELL_SIZE / 8); if (reader.GetStatus() == CAmxxReader::Err_None) { size_t bufSize = reader.GetBufferSize(); @@ -164,6 +164,15 @@ int load_amxscript(AMX *amx, void **program, const char *filename, char error[64 case CAmxxReader::Err_FileInvalid: strcpy(error, "Invalid Plugin"); return (amx->error = AMX_ERR_FORMAT); + case CAmxxReader::Err_SectionNotFound: + strcpy(error, "Searched section not found (.amxx)"); + return (amx->error = AMX_ERR_NOTFOUND); + case CAmxxReader::Err_DecompressorInit: + strcpy(error, "Decompressor initialization failed"); + return (amx->error = AMX_ERR_INIT); + case CAmxxReader::Err_Decompress: + strcpy(error, "Internal error: Decompress"); + return (amx->error = AMX_ERR_NOTFOUND); default: strcpy(error, "Unknown error"); return (amx->error = AMX_ERR_NOTFOUND);