Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Don’t use Base_directory before it’s been set
Before this change, the Base_directory variable would get accessed before we set its value. This seems to be OK. I’m not sure about the details, but it seems like C++ guarantees that Base_directory will be filled with zeros when it’s created. That being said, the code that was modified by this commit used to be misleading. The code would copy the contents of the Base_directory variable into another variable named path. If you read the code, you would think that path would be set to something along the lines of "C:\\Games\\Descent3" or "/home/username/D3-open-source", but in reality, path would be set to "". This change makes it clear that path is guaranteed to be set to "". The main motivation behind this commit is to make it easier to create a future commit. That future commit will replace Base_directory with a new variable named Base_directories. Base_directories will have a different data type that does not get filled with zeros by default. In other words, we need to set the new Base_directories variable before we use it. Unfortunately, neither the current Base_directory variable nor the future Base_directories variable will get set in time. Both of them will be set after path variable gets set. This commit allows me to not worry about that detail when I create the future Base_directories commit.
- Loading branch information