*Allow to fish in shallow water.
--HG-- branch : trunk
This commit is contained in:
+2
-2
@@ -1989,7 +1989,7 @@ void Map::GetZoneAndAreaIdByAreaFlag(uint32& zoneid, uint32& areaid, uint16 area
|
|||||||
zoneid = entry ? (( entry->zone != 0 ) ? entry->zone : entry->ID) : 0;
|
zoneid = entry ? (( entry->zone != 0 ) ? entry->zone : entry->ID) : 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool Map::IsInWater(float x, float y, float pZ) const
|
bool Map::IsInWater(float x, float y, float pZ, float min_depth) const
|
||||||
{
|
{
|
||||||
// Check surface in x, y point for liquid
|
// Check surface in x, y point for liquid
|
||||||
if (GridMap* gmap = const_cast<Map*>(this)->GetGrid(x, y))
|
if (GridMap* gmap = const_cast<Map*>(this)->GetGrid(x, y))
|
||||||
@@ -1997,7 +1997,7 @@ bool Map::IsInWater(float x, float y, float pZ) const
|
|||||||
LiquidData liquid_status;
|
LiquidData liquid_status;
|
||||||
if (getLiquidStatus(x, y, pZ, MAP_ALL_LIQUIDS, &liquid_status))
|
if (getLiquidStatus(x, y, pZ, MAP_ALL_LIQUIDS, &liquid_status))
|
||||||
{
|
{
|
||||||
if (liquid_status.level - liquid_status.depth_level > 2)
|
if (liquid_status.level - liquid_status.depth_level > min_depth)
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
+1
-1
@@ -310,7 +310,7 @@ class MANGOS_DLL_SPEC Map : public GridRefManager<NGridType>, public MaNGOS::Obj
|
|||||||
// can return INVALID_HEIGHT if under z+2 z coord not found height
|
// can return INVALID_HEIGHT if under z+2 z coord not found height
|
||||||
float GetHeight(float x, float y, float z, bool pCheckVMap=true) const;
|
float GetHeight(float x, float y, float z, bool pCheckVMap=true) const;
|
||||||
float GetVmapHeight(float x, float y, float z, bool useMaps) const;
|
float GetVmapHeight(float x, float y, float z, bool useMaps) const;
|
||||||
bool IsInWater(float x, float y, float z) const; // does not use z pos. This is for future use
|
bool IsInWater(float x, float y, float z, float min_depth = 2.0f) const;
|
||||||
|
|
||||||
ZLiquidStatus getLiquidStatus(float x, float y, float z, uint8 ReqLiquidType, LiquidData *data = 0) const;
|
ZLiquidStatus getLiquidStatus(float x, float y, float z, uint8 ReqLiquidType, LiquidData *data = 0) const;
|
||||||
|
|
||||||
|
|||||||
@@ -6423,7 +6423,7 @@ void Spell::EffectTransmitted(uint32 effIndex)
|
|||||||
|
|
||||||
if(goinfo->type==GAMEOBJECT_TYPE_FISHINGNODE)
|
if(goinfo->type==GAMEOBJECT_TYPE_FISHINGNODE)
|
||||||
{
|
{
|
||||||
if ( !cMap->IsInWater(fx, fy, fz-0.5f)) // Hack to prevent fishing bobber from failing to land on fishing hole
|
if ( !cMap->IsInWater(fx, fy, fz-0.5f, 0.5f)) // Hack to prevent fishing bobber from failing to land on fishing hole
|
||||||
{ // but this is not proper, we really need to ignore not materialized objects
|
{ // but this is not proper, we really need to ignore not materialized objects
|
||||||
SendCastResult(SPELL_FAILED_NOT_HERE);
|
SendCastResult(SPELL_FAILED_NOT_HERE);
|
||||||
SendChannelUpdate(0);
|
SendChannelUpdate(0);
|
||||||
|
|||||||
Reference in New Issue
Block a user