[ZoneBuilder] Check if CSV exists

This commit is contained in:
momo5502 2017-04-04 22:35:30 +02:00
parent 5c54b864e4
commit 59d8c85640
4 changed files with 14 additions and 1 deletions

View File

@ -92,6 +92,12 @@ namespace Components
void ZoneBuilder::Zone::Zone::build()
{
if(!this->dataMap.isValid())
{
Logger::Print("Unable to load CSV for '%s'!\n", this->zoneName.data());
return;
}
this->loadFastFiles();
Logger::Print("Linking assets...\n");

View File

@ -3135,7 +3135,8 @@ namespace Game
unsigned int count;
};
struct __declspec(align(8)) DpvsStaticCellCmd
#pragma pack(push, 1)
struct DpvsStaticCellCmd
{
DpvsPlane *planes;
GfxAabbTree *tree;
@ -3143,6 +3144,7 @@ namespace Game
char frustumPlaneCount;
unsigned __int16 sceneViewType;
};
#pragma pack(pop)
struct GfxPortal
{

View File

@ -4,6 +4,7 @@ namespace Utils
{
CSV::CSV(std::string file, bool isFile, bool allowComments)
{
this->valid = false;
this->parse(file, isFile, allowComments);
}
@ -72,6 +73,7 @@ namespace Utils
{
if (!Utils::IO::FileExists(file)) return;
buffer = Utils::IO::ReadFile(file);
this->valid = true;
}
else
{

View File

@ -15,7 +15,10 @@ namespace Utils
std::string getElementAt(size_t row, size_t column);
bool isValid() { return this->valid; }
private:
bool valid;
std::vector<std::vector<std::string>> dataMap;
void parse(std::string file, bool isFile = true, bool allowComments = true);