- for (filenum = 0;filenum < PRVM_MAX_OPENFILES;filenum++)
- if (prog->openfiles[filenum] == NULL)
- break;
- prog->openfiles[filenum] = FS_OpenVirtualFile(va(vabuf, sizeof(vabuf), "data/%s", filename), false);
- if (prog->openfiles[filenum] == NULL)
- prog->openfiles[filenum] = FS_OpenVirtualFile(va(vabuf, sizeof(vabuf), "%s", filename), false);
- if (prog->openfiles[filenum] == NULL)
+ file = FS_OpenVirtualFile(va(vabuf, sizeof(vabuf), "data/%s", filename), false);
+ if (file == NULL)
+ file = FS_OpenVirtualFile(va(vabuf, sizeof(vabuf), "%s", filename), false);
+ if (file == NULL)