mirror of
https://git.code.sf.net/p/quake/quakeforge
synced 2025-04-25 11:01:16 +00:00
handle file openning issues a little more gracefully
This commit is contained in:
parent
3607fecafd
commit
abe657ea12
1 changed files with 5 additions and 1 deletions
|
@ -770,14 +770,16 @@ main (int argc, char **argv)
|
||||||
DecodeArgs (argc, argv);
|
DecodeArgs (argc, argv);
|
||||||
|
|
||||||
if (!options.bspfile) {
|
if (!options.bspfile) {
|
||||||
Sys_Error ("%s: no bsp file specified.", this_program);
|
|
||||||
usage (1);
|
usage (1);
|
||||||
|
Sys_Error ("%s: no bsp file specified.", this_program);
|
||||||
}
|
}
|
||||||
|
|
||||||
QFS_StripExtension (options.bspfile, options.bspfile);
|
QFS_StripExtension (options.bspfile, options.bspfile);
|
||||||
QFS_DefaultExtension (options.bspfile, ".bsp");
|
QFS_DefaultExtension (options.bspfile, ".bsp");
|
||||||
|
|
||||||
f = Qopen (options.bspfile, "rb");
|
f = Qopen (options.bspfile, "rb");
|
||||||
|
if (!f)
|
||||||
|
Sys_Error ("couldn't open %s for reading.", options.bspfile);
|
||||||
bsp = LoadBSPFile (f, Qfilesize (f));
|
bsp = LoadBSPFile (f, Qfilesize (f));
|
||||||
Qclose (f);
|
Qclose (f);
|
||||||
|
|
||||||
|
@ -805,6 +807,8 @@ main (int argc, char **argv)
|
||||||
CalcAmbientSounds ();
|
CalcAmbientSounds ();
|
||||||
|
|
||||||
f = Qopen (options.bspfile, "wb");
|
f = Qopen (options.bspfile, "wb");
|
||||||
|
if (!f)
|
||||||
|
Sys_Error ("couldn't open %s for writing.", options.bspfile);
|
||||||
WriteBSPFile (bsp, f);
|
WriteBSPFile (bsp, f);
|
||||||
Qclose (f);
|
Qclose (f);
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue