refactor(Core/Misc): add braces and impove codestyle (#6402)

This commit is contained in:
Kargatum
2021-06-25 00:50:18 +07:00
committed by GitHub
parent 33c271cc7c
commit 3c24b511f2
72 changed files with 1486 additions and 401 deletions

View File

@@ -65,9 +65,13 @@ namespace VMAP
// M2 files don't contain area info, only WMO files
if (flags & MOD_M2)
{
return;
}
if (!iBound.contains(p))
{
return;
}
// child bounds are defined in object space:
Vector3 pModel = iInvRot * (p - iPos) * iInvScale;
Vector3 zDirModel = iInvRot * Vector3(0.f, 0.f, -1.f);
@@ -99,9 +103,13 @@ namespace VMAP
// M2 files don't contain area info, only WMO files
if (flags & MOD_M2)
{
return false;
}
if (!iBound.contains(p))
{
return false;
}
// child bounds are defined in object space:
Vector3 pModel = iInvRot * (p - iPos) * iInvScale;
Vector3 zDirModel = iInvRot * Vector3(0.f, 0.f, -1.f);
@@ -147,7 +155,9 @@ namespace VMAP
if (!check)
{
if (ferror(rf))
{
std::cout << "Error reading ModelSpawn!\n";
}
return false;
}
check += fread(&spawn.adtId, sizeof(uint16), 1, rf);
@@ -202,9 +212,9 @@ namespace VMAP
}
uint32 nameLen = spawn.name.length();
check += fwrite(&nameLen, sizeof(uint32), 1, wf);
if (check != uint32(has_bound ? 17 : 11)) return false;
if (check != uint32(has_bound ? 17 : 11)) { return false; }
check = fwrite(spawn.name.c_str(), sizeof(char), nameLen, wf);
if (check != nameLen) return false;
if (check != nameLen) { return false; }
return true;
}