mirror of
https://git.code.sf.net/p/quake/quakeforge
synced 2024-11-22 20:41:20 +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);
|
||||
|
||||
if (!options.bspfile) {
|
||||
Sys_Error ("%s: no bsp file specified.", this_program);
|
||||
usage (1);
|
||||
Sys_Error ("%s: no bsp file specified.", this_program);
|
||||
}
|
||||
|
||||
QFS_StripExtension (options.bspfile, options.bspfile);
|
||||
QFS_DefaultExtension (options.bspfile, ".bsp");
|
||||
|
||||
f = Qopen (options.bspfile, "rb");
|
||||
if (!f)
|
||||
Sys_Error ("couldn't open %s for reading.", options.bspfile);
|
||||
bsp = LoadBSPFile (f, Qfilesize (f));
|
||||
Qclose (f);
|
||||
|
||||
|
@ -805,6 +807,8 @@ main (int argc, char **argv)
|
|||
CalcAmbientSounds ();
|
||||
|
||||
f = Qopen (options.bspfile, "wb");
|
||||
if (!f)
|
||||
Sys_Error ("couldn't open %s for writing.", options.bspfile);
|
||||
WriteBSPFile (bsp, f);
|
||||
Qclose (f);
|
||||
|
||||
|
|
Loading…
Reference in a new issue