diff options
Diffstat (limited to 'src/server/collision')
| -rwxr-xr-x | src/server/collision/BoundingIntervalHierarchy.cpp | 2 | ||||
| -rw-r--r-- | src/server/collision/Maps/MapTree.cpp | 4 | ||||
| -rw-r--r-- | src/server/collision/Models/ModelInstance.cpp | 12 | ||||
| -rw-r--r-- | src/server/collision/Models/WorldModel.cpp | 8 |
4 files changed, 14 insertions, 12 deletions
diff --git a/src/server/collision/BoundingIntervalHierarchy.cpp b/src/server/collision/BoundingIntervalHierarchy.cpp index ca2dc9c1645..470f89e6a69 100755 --- a/src/server/collision/BoundingIntervalHierarchy.cpp +++ b/src/server/collision/BoundingIntervalHierarchy.cpp @@ -21,7 +21,7 @@ void BIH::buildHierarchy(std::vector<uint32> &tempTree, buildData &dat, BuildStats &stats) { // create space for the first node - tempTree.push_back(3 << 30); // dummy leaf + tempTree.push_back(uint32(3 << 30)); // dummy leaf tempTree.insert(tempTree.end(), 2, 0); //tempTree.add(0); diff --git a/src/server/collision/Maps/MapTree.cpp b/src/server/collision/Maps/MapTree.cpp index 4c9598ce242..f447e74901e 100644 --- a/src/server/collision/Maps/MapTree.cpp +++ b/src/server/collision/Maps/MapTree.cpp @@ -289,7 +289,7 @@ namespace VMAP char chunk[8]; //general info if (!readChunk(rf, chunk, VMAP_MAGIC, 8)) success = false; - char tiled; + char tiled = '\0'; if (success && fread(&tiled, sizeof(char), 1, rf) != 1) success = false; iIsTiled = bool(tiled); // Nodes @@ -370,7 +370,7 @@ namespace VMAP if (!readChunk(tf, chunk, VMAP_MAGIC, 8)) result = false; - uint32 numSpawns; + uint32 numSpawns = 0; if (result && fread(&numSpawns, sizeof(uint32), 1, tf) != 1) result = false; for (uint32 i=0; i<numSpawns && result; ++i) diff --git a/src/server/collision/Models/ModelInstance.cpp b/src/server/collision/Models/ModelInstance.cpp index 57e1e42d579..e9258fdb522 100644 --- a/src/server/collision/Models/ModelInstance.cpp +++ b/src/server/collision/Models/ModelInstance.cpp @@ -153,7 +153,7 @@ namespace VMAP bool ModelSpawn::readFromFile(FILE *rf, ModelSpawn &spawn) { - uint32 check=0, nameLen; + uint32 check = 0, nameLen; check += fread(&spawn.flags, sizeof(uint32), 1, rf); // EoF? if (!check) @@ -176,13 +176,13 @@ namespace VMAP spawn.iBound = G3D::AABox(bLow, bHigh); } check += fread(&nameLen, sizeof(uint32), 1, rf); - if(check != (has_bound ? 17 : 11)) + if (check != uint32(has_bound ? 17 : 11)) { std::cout << "Error reading ModelSpawn!\n"; return false; } char nameBuff[500]; - if (nameLen>500) // file names should never be that long, must be file error + if (nameLen > 500) // file names should never be that long, must be file error { std::cout << "Error reading ModelSpawn, file name too long!\n"; return false; @@ -207,16 +207,16 @@ namespace VMAP check += fwrite(&spawn.iRot, sizeof(float), 3, wf); check += fwrite(&spawn.iScale, sizeof(float), 1, wf); bool has_bound = (spawn.flags & MOD_HAS_BOUND); - if(has_bound) // only WMOs have bound in MPQ, only available after computation + if (has_bound) // only WMOs have bound in MPQ, only available after computation { check += fwrite(&spawn.iBound.low(), sizeof(float), 3, wf); check += fwrite(&spawn.iBound.high(), sizeof(float), 3, wf); } uint32 nameLen = spawn.name.length(); check += fwrite(&nameLen, sizeof(uint32), 1, wf); - if(check != (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; } diff --git a/src/server/collision/Models/WorldModel.cpp b/src/server/collision/Models/WorldModel.cpp index 8f6c3669690..ce93ec78557 100644 --- a/src/server/collision/Models/WorldModel.cpp +++ b/src/server/collision/Models/WorldModel.cpp @@ -303,11 +303,12 @@ namespace VMAP { char chunk[8]; bool result = true; - uint32 chunkSize, count; + uint32 chunkSize = 0; + uint32 count = 0; triangles.clear(); vertices.clear(); delete iLiquid; - iLiquid = 0; + iLiquid = NULL; if (result && fread(&iBound, sizeof(G3D::AABox), 1, rf) != 1) result = false; if (result && fread(&iMogpFlags, sizeof(uint32), 1, rf) != 1) result = false; @@ -538,7 +539,8 @@ namespace VMAP return false; bool result = true; - uint32 chunkSize, count; + uint32 chunkSize = 0; + uint32 count = 0; char chunk[8]; // Ignore the added magic header if (!readChunk(rf, chunk, VMAP_MAGIC, 8)) result = false; |
