mirror of
https://github.com/celisej567/LibBSP.git
synced 2026-09-11 20:09:36 +03:00
Fix BSPReader throwing exception when attempting to open a read-only file.
This commit is contained in:
@@ -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>
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user