Fix BSPReader throwing exception when attempting to open a read-only file.

This commit is contained in:
Will
2015-11-10 19:28:43 -07:00
parent 9aa197fe1f
commit f5c751e217
2 changed files with 2 additions and 2 deletions

View File

@@ -437,7 +437,7 @@ namespace LibBSP {
/// <summary>
/// Gets a Vector attribute as a <c>Vector4</c>. This will only read as many values as are in the attribute, and can be
/// implicitly converted to Vector3, Vector2, or Color. Throws if the attribute could not be converted to a Vector.
/// implicitly converted to Vector3, Vector2, or Color.
/// </summary>
/// <param name="key">Name of the attribute to retrieve</param>
/// <returns>Vector representation of the components of the attribute</returns>

View File

@@ -25,7 +25,7 @@ namespace LibBSP {
if (!File.Exists(file.FullName)) {
throw new FileNotFoundException("Unable to open BSP file; file " + file.FullName + " not found.");
} else {
this.stream = new FileStream(file.FullName, FileMode.Open);
this.stream = new FileStream(file.FullName, FileMode.Open, FileAccess.Read);
this.binaryReader = new BinaryReader(this.stream);
}
}