added handlers for 3 new error messages from CAmxxReader

This commit is contained in:
Pavol Marko 2004-07-22 14:55:16 +00:00
parent cfbf4bf5b5
commit 82d5b42356

View File

@ -132,7 +132,7 @@ int load_amxscript(AMX *amx, void **program, const char *filename, char error[64
*/ */
*error = 0; *error = 0;
CAmxxReader reader(filename, SMALL_CELL_SIZE); CAmxxReader reader(filename, SMALL_CELL_SIZE / 8);
if (reader.GetStatus() == CAmxxReader::Err_None) if (reader.GetStatus() == CAmxxReader::Err_None)
{ {
size_t bufSize = reader.GetBufferSize(); 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: case CAmxxReader::Err_FileInvalid:
strcpy(error, "Invalid Plugin"); strcpy(error, "Invalid Plugin");
return (amx->error = AMX_ERR_FORMAT); 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: default:
strcpy(error, "Unknown error"); strcpy(error, "Unknown error");
return (amx->error = AMX_ERR_NOTFOUND); return (amx->error = AMX_ERR_NOTFOUND);