mirror of
https://github.com/alliedmodders/amxmodx.git
synced 2024-12-25 06:15:37 +03:00
added handlers for 3 new error messages from CAmxxReader
This commit is contained in:
parent
cfbf4bf5b5
commit
82d5b42356
@ -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);
|
||||||
|
Loading…
Reference in New Issue
Block a user