mirror of
https://github.com/mangosfour/server.git
synced 2025-12-14 16:37:01 +00:00
[7444] Fixed some recently added and old type conversion warnings.
This commit is contained in:
parent
719991d381
commit
1ed2f1e65d
3 changed files with 15 additions and 13 deletions
|
|
@ -125,8 +125,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);
|
||||
|
|
|
|||
|
|
@ -65,7 +65,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;
|
||||
|
|
@ -1081,7 +1082,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))
|
||||
|
|
@ -1132,7 +1134,7 @@ 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;
|
||||
|
|
@ -1149,7 +1151,7 @@ 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;
|
||||
|
|
@ -1192,7 +1194,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;
|
||||
|
|
@ -1529,7 +1531,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
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
#ifndef __REVISION_NR_H__
|
||||
#define __REVISION_NR_H__
|
||||
#define REVISION_NR "7443"
|
||||
#define REVISION_NR "7444"
|
||||
#endif // __REVISION_NR_H__
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue