ACC support: fixed a crash when trying to load non-existent include file.

This commit is contained in:
MaxED 2016-02-28 22:15:17 +00:00
parent 95e28518cb
commit 4586c209a2
4 changed files with 5 additions and 6 deletions

View file

@ -78,9 +78,8 @@ namespace CodeImp.DoomBuilder.Compilers
foreach(string include in includes)
{
// Grab the script text from the resources
TextResourceData data = General.Map.Data.LoadFile(include);
if(data.Stream != null)
TextResourceData data = General.Map.Data.GetTextResourceData(include);
if(data != null && data.Stream != null)
{
// Pull the pk3 or directory sub folder out if applicable
FileInfo fi = new FileInfo(Path.Combine(this.tempdir.FullName, include));

View file

@ -177,7 +177,7 @@ namespace CodeImp.DoomBuilder.Controls
{
OnInclude = delegate(AcsParserSE se, string includefile, AcsParserSE.IncludeType includetype)
{
TextResourceData data = General.Map.Data.LoadFile(includefile);
TextResourceData data = General.Map.Data.GetTextResourceData(includefile);
if(data == null)
{
// Fial

View file

@ -2350,7 +2350,7 @@ namespace CodeImp.DoomBuilder.Data
}
//mxd
internal TextResourceData LoadFile(string name)
internal TextResourceData GetTextResourceData(string name)
{
// Filesystem path?
if(Path.IsPathRooted(name))

View file

@ -2157,7 +2157,7 @@ namespace CodeImp.DoomBuilder
IgnoreErrors = true,
OnInclude = delegate(AcsParserSE se, string includefile, AcsParserSE.IncludeType includetype)
{
TextResourceData includedata = General.Map.Data.LoadFile(includefile);
TextResourceData includedata = General.Map.Data.GetTextResourceData(includefile);
if(includedata != null)
{
includedata.Trackable = true;