From 2239ca4d6792958cd1c55676697d8c27f0e4d8df Mon Sep 17 00:00:00 2001 From: Zack Middleton Date: Tue, 24 Sep 2024 20:37:01 -0500 Subject: [PATCH] Fix reading non-sequential lumps in AAS files in pk3 files FS_Seek() doesn't always return 0 on success. If the file in a pk3 file it returns the seek offset. This change doesn't fix any known AAS files. --- code/botlib/be_aas_file.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/code/botlib/be_aas_file.c b/code/botlib/be_aas_file.c index 3de8f78030..fea464115b 100644 --- a/code/botlib/be_aas_file.c +++ b/code/botlib/be_aas_file.c @@ -300,7 +300,7 @@ char *AAS_LoadAASLump(fileHandle_t fp, int offset, int length, int *lastoffset, if (offset != *lastoffset) { botimport.Print(PRT_WARNING, "AAS file not sequentially read\n"); - if (botimport.FS_Seek(fp, offset, FS_SEEK_SET)) + if (botimport.FS_Seek(fp, offset, FS_SEEK_SET) < 0) { AAS_Error("can't seek to aas lump\n"); AAS_DumpAASData();