mirror of
https://github.com/mangosfour/server.git
synced 2025-12-16 04:37:00 +00:00
[8475] fixed some gcc-warnings
all warnings from Wunused
and some from Wall
cause unused may be most interesting for some:
they were in following files:
src/game/Level2.cpp
src/game/Map.cpp
src/game/SpellAuras.cpp
src/game/Unit.cpp
src/mangosd/Master.cpp
but i guess mostly someone just fogot to remove this code
for some unsigned vs signed warnings i used:
ack "for.*int .*size\(\)" | ack -v uint
also note for coding:
if you do something like
if( a && b || c)
just place parentheses around (a && b) && always will have
precedence over || but without parentheses this could be overseen
quite fast (at least that's my guess why gcc will warn for this)
Signed-off-by: balrok <der-coole-carl@gmx.net>
This commit is contained in:
parent
56ddf40d62
commit
bd30769dec
36 changed files with 96 additions and 101 deletions
|
|
@ -1789,7 +1789,8 @@ uint16 Map::GetAreaFlag(float x, float y, float z) const
|
|||
// Makers' Overlook (ground and cave)
|
||||
else if (x > 5634.48f && x < 5774.53f && y < 3475.0f && z > 300.0f)
|
||||
{
|
||||
if(y > 3380.26f || y > 3265.0f && z < 360.0f) areaflag = 2187;
|
||||
if (y > 3380.26f || (y > 3265.0f && z < 360.0f))
|
||||
areaflag = 2187;
|
||||
}
|
||||
break;
|
||||
// The Makers' Perch (underground)
|
||||
|
|
@ -1868,7 +1869,7 @@ void Map::GetZoneAndAreaIdByAreaFlag(uint32& zoneid, uint32& areaid, uint16 area
|
|||
bool Map::IsInWater(float x, float y, float pZ) const
|
||||
{
|
||||
// Check surface in x, y point for liquid
|
||||
if (GridMap* gmap = const_cast<Map*>(this)->GetGrid(x, y))
|
||||
if (const_cast<Map*>(this)->GetGrid(x, y))
|
||||
{
|
||||
LiquidData liquid_status;
|
||||
if (getLiquidStatus(x, y, pZ, MAP_ALL_LIQUIDS, &liquid_status))
|
||||
|
|
@ -1882,7 +1883,7 @@ bool Map::IsInWater(float x, float y, float pZ) const
|
|||
|
||||
bool Map::IsUnderWater(float x, float y, float z) const
|
||||
{
|
||||
if (GridMap* gmap = const_cast<Map*>(this)->GetGrid(x, y))
|
||||
if (const_cast<Map*>(this)->GetGrid(x, y))
|
||||
{
|
||||
if (getLiquidStatus(x, y, z, MAP_LIQUID_TYPE_WATER|MAP_LIQUID_TYPE_OCEAN)&LIQUID_MAP_UNDER_WATER)
|
||||
return true;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue