From f5c751e217a5c14125a69205ff6c9043e33c250b Mon Sep 17 00:00:00 2001 From: Will Date: Tue, 10 Nov 2015 19:28:43 -0700 Subject: [PATCH] Fix BSPReader throwing exception when attempting to open a read-only file. --- LibBSP/Source/Structs/Common/Entity.cs | 2 +- LibBSP/Source/Util/BSPReader.cs | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/LibBSP/Source/Structs/Common/Entity.cs b/LibBSP/Source/Structs/Common/Entity.cs index 45c0c6a..d7d402d 100644 --- a/LibBSP/Source/Structs/Common/Entity.cs +++ b/LibBSP/Source/Structs/Common/Entity.cs @@ -437,7 +437,7 @@ namespace LibBSP { /// /// Gets a Vector attribute as a Vector4. 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. /// /// Name of the attribute to retrieve /// Vector representation of the components of the attribute diff --git a/LibBSP/Source/Util/BSPReader.cs b/LibBSP/Source/Util/BSPReader.cs index e7bfeb6..5b96f92 100644 --- a/LibBSP/Source/Util/BSPReader.cs +++ b/LibBSP/Source/Util/BSPReader.cs @@ -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); } }