diff options
author | Kargatum <dowlandtop@yandex.com> | 2021-06-25 00:50:18 +0700 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-06-24 19:50:18 +0200 |
commit | 3c24b511f2fb2b23618e9cd0b24d28cb5afa34ad (patch) | |
tree | 78baa1669874acf8b7adf1c1994e383e814a3146 /src/common/Collision/Models/ModelInstance.cpp | |
parent | 33c271cc7c191f72406873d81abd954525d093c0 (diff) |
refactor(Core/Misc): add braces and impove codestyle (#6402)
Diffstat (limited to 'src/common/Collision/Models/ModelInstance.cpp')
-rw-r--r-- | src/common/Collision/Models/ModelInstance.cpp | 14 |
1 files changed, 12 insertions, 2 deletions
diff --git a/src/common/Collision/Models/ModelInstance.cpp b/src/common/Collision/Models/ModelInstance.cpp index 7341640535..01e2219cd6 100644 --- a/src/common/Collision/Models/ModelInstance.cpp +++ b/src/common/Collision/Models/ModelInstance.cpp @@ -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; } |