mirror of
https://github.com/TrinityCore/TrinityCore.git
synced 2026-01-19 17:05:44 +01:00
[7444] Fixed some recently added and old type conversion warnings. Author: VladimirMangos
--HG-- branch : trunk
This commit is contained in:
@@ -129,8 +129,8 @@ bool GameObject::Create(uint32 guidlow, uint32 name_id, Map *map, uint32 phaseMa
|
||||
|
||||
int64 rotation = 0;
|
||||
|
||||
float f_rot1 = sin(ang / 2.0f);
|
||||
int64 i_rot1 = f_rot1 / atan(pow(2.0f, -20.0f));
|
||||
double f_rot1 = sin(ang / 2.0f);
|
||||
int64 i_rot1 = int64(f_rot1 / atan(pow(2.0f, -20.0f)));
|
||||
rotation |= (i_rot1 << 43 >> 43) & 0x00000000001FFFFF;
|
||||
|
||||
//float f_rot2 = sin(0.0f / 2.0f);
|
||||
|
||||
@@ -67,7 +67,8 @@ bool Map::ExistMap(uint32 mapid,int x,int y)
|
||||
|
||||
map_fileheader header;
|
||||
fread(&header, sizeof(header), 1, pf);
|
||||
if (header.mapMagic != MAP_MAGIC || header.versionMagic != MAP_VERSION_MAGIC)
|
||||
if (header.mapMagic != uint32(MAP_MAGIC) ||
|
||||
header.versionMagic != uint32(MAP_VERSION_MAGIC))
|
||||
{
|
||||
sLog.outError("Map file '%s' is non-compatible version (outdated?). Please, create new using ad.exe program.",tmp);
|
||||
delete [] tmp;
|
||||
@@ -1174,7 +1175,8 @@ bool GridMap::loadData(char *filename)
|
||||
if (!in)
|
||||
return true;
|
||||
fread(&header, sizeof(header),1,in);
|
||||
if (header.mapMagic == MAP_MAGIC && header.versionMagic == MAP_VERSION_MAGIC)
|
||||
if (header.mapMagic == uint32(MAP_MAGIC) &&
|
||||
header.versionMagic == uint32(MAP_VERSION_MAGIC))
|
||||
{
|
||||
// loadup area data
|
||||
if (header.areaMapOffset && !loadAreaData(in, header.areaMapOffset, header.areaMapSize))
|
||||
@@ -1225,11 +1227,11 @@ bool GridMap::loadAreaData(FILE *in, uint32 offset, uint32 size)
|
||||
map_areaHeader header;
|
||||
fseek(in, offset, SEEK_SET);
|
||||
fread(&header, sizeof(header), 1, in);
|
||||
if (header.fourcc != MAP_AREA_MAGIC)
|
||||
if (header.fourcc != uint32(MAP_AREA_MAGIC))
|
||||
return false;
|
||||
|
||||
m_gridArea = header.gridArea;
|
||||
if (!(header.flags&MAP_AREA_NO_AREA))
|
||||
if (!(header.flags & MAP_AREA_NO_AREA))
|
||||
{
|
||||
m_area_map = new uint16 [16*16];
|
||||
fread(m_area_map, sizeof(uint16), 16*16, in);
|
||||
@@ -1242,13 +1244,13 @@ bool GridMap::loadHeihgtData(FILE *in, uint32 offset, uint32 size)
|
||||
map_heightHeader header;
|
||||
fseek(in, offset, SEEK_SET);
|
||||
fread(&header, sizeof(header), 1, in);
|
||||
if (header.fourcc != MAP_HEIGTH_MAGIC)
|
||||
if (header.fourcc != uint32(MAP_HEIGTH_MAGIC))
|
||||
return false;
|
||||
|
||||
m_gridHeight = header.gridHeight;
|
||||
if (!(header.flags&MAP_HEIGHT_NO_HIGHT))
|
||||
if (!(header.flags & MAP_HEIGHT_NO_HIGHT))
|
||||
{
|
||||
if ((header.flags&MAP_HEIGHT_AS_INT16))
|
||||
if ((header.flags & MAP_HEIGHT_AS_INT16))
|
||||
{
|
||||
m_uint16_V9 = new uint16 [129*129];
|
||||
m_uint16_V8 = new uint16 [128*128];
|
||||
@@ -1257,7 +1259,7 @@ bool GridMap::loadHeihgtData(FILE *in, uint32 offset, uint32 size)
|
||||
m_gridIntHeightMultiplier = (header.gridMaxHeight - header.gridHeight) / 65535;
|
||||
m_gridGetHeight = &GridMap::getHeightFromUint16;
|
||||
}
|
||||
else if ((header.flags&MAP_HEIGHT_AS_INT8))
|
||||
else if ((header.flags & MAP_HEIGHT_AS_INT8))
|
||||
{
|
||||
m_uint8_V9 = new uint8 [129*129];
|
||||
m_uint8_V8 = new uint8 [128*128];
|
||||
@@ -1285,7 +1287,7 @@ bool GridMap::loadLiquidData(FILE *in, uint32 offset, uint32 size)
|
||||
map_liquidHeader header;
|
||||
fseek(in, offset, SEEK_SET);
|
||||
fread(&header, sizeof(header), 1, in);
|
||||
if (header.fourcc != MAP_LIQUID_MAGIC)
|
||||
if (header.fourcc != uint32(MAP_LIQUID_MAGIC))
|
||||
return false;
|
||||
|
||||
m_liquidType = header.liquidType;
|
||||
@@ -1622,7 +1624,7 @@ inline ZLiquidStatus GridMap::getLiquidStatus(float x, float y, float z, uint8 R
|
||||
}
|
||||
|
||||
// For speed check as int values
|
||||
int delta = (liquid_level - z) * 10;
|
||||
int delta = int((liquid_level - z) * 10);
|
||||
|
||||
// Get position delta
|
||||
if (delta > 20) // Under water
|
||||
|
||||
Reference in New Issue
Block a user