Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
2d164a0
commit ee35900
Showing
1 changed file
with
3 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
ee35900
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Some players are now getting this debug: "Unable to read XML file @images.xml @ 'xmlLoadFile' [Line 0: Failed to open file]" is that because the file doesn't exist? But there is no function to check if an XML file exists, so this debug is actually just annoying rather than helpful.
ee35900
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
fileExists
should workee35900
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
check my example script. There are line 8
xmlLoadFile("meta.xml")
meta.xml exists, 0 error/warning. 1-7 line print erroree35900
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This commit has been reverted. Please make a new pull request which excludes a warning for non existent files.
ee35900
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What do you think about just logging a warning instead of throwing an error?
ee35900
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It was a debug warning.
ee35900
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@ArranTuna why would you try to load a non existent file in the first place?
ee35900
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Because whoever wrote the script didn't realise or think they could use fileExists to see if it existed which you can't blame them for if xmlLoadFile simply returned false if it didn't exist because then they could use that fact to determine whether the XML file existed or not.
ee35900
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@ArranTuna that's what debug messages are for, they notify the programmer about a potentially bad coding practice, defects or problems. A warning message won't break any compatibility since it doesn't stop the execution of the script and xmlLoadFile will still return false. It will help scripters improve their code and/or track down problems. Functions like dxCreateTexture already work this way so I don't see why xmlLoadFile should be different.