mirror of
https://github.com/EQEmu/Server.git
synced 2025-12-16 05:11:29 +00:00
InLiquid converted to xyz_location
This commit is contained in:
parent
29573d7d19
commit
6cd614a05e
@ -2478,8 +2478,9 @@ void Mob::AddToHateList(Mob* other, int32 hate, int32 damage, bool iYellForHelp,
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
auto otherPosition = xyz_location(other->GetX(), other->GetY(), other->GetZ());
|
||||||
if(IsNPC() && CastToNPC()->IsUnderwaterOnly() && zone->HasWaterMap()) {
|
if(IsNPC() && CastToNPC()->IsUnderwaterOnly() && zone->HasWaterMap()) {
|
||||||
if(!zone->watermap->InLiquid(other->GetX(), other->GetY(), other->GetZ())) {
|
if(!zone->watermap->InLiquid(otherPosition)) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -4595,13 +4595,8 @@ void Client::Handle_OP_ClientUpdate(const EQApplicationPacket *app)
|
|||||||
safe_delete(outapp);
|
safe_delete(outapp);
|
||||||
}
|
}
|
||||||
|
|
||||||
if(zone->watermap)
|
if(zone->watermap && zone->watermap->InLiquid(m_Position))
|
||||||
{
|
|
||||||
if(zone->watermap->InLiquid(m_Position.m_X, m_Position.m_Y, m_Position.m_Z))
|
|
||||||
{
|
|
||||||
CheckIncreaseSkill(SkillSwimming, nullptr, -17);
|
CheckIncreaseSkill(SkillSwimming, nullptr, -17);
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|||||||
@ -303,8 +303,9 @@ Mob *HateList::GetTop(Mob *center)
|
|||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
auto hateEntryPosition = xyz_location(cur->ent->GetX(), cur->ent->GetY(), cur->ent->GetZ());
|
||||||
if(center->IsNPC() && center->CastToNPC()->IsUnderwaterOnly() && zone->HasWaterMap()) {
|
if(center->IsNPC() && center->CastToNPC()->IsUnderwaterOnly() && zone->HasWaterMap()) {
|
||||||
if(!zone->watermap->InLiquid(cur->ent->GetX(), cur->ent->GetY(), cur->ent->GetZ())) {
|
if(!zone->watermap->InLiquid(hateEntryPosition)) {
|
||||||
skipped_count++;
|
skipped_count++;
|
||||||
++iterator;
|
++iterator;
|
||||||
continue;
|
continue;
|
||||||
@ -428,8 +429,9 @@ Mob *HateList::GetTop(Mob *center)
|
|||||||
while(iterator != list.end())
|
while(iterator != list.end())
|
||||||
{
|
{
|
||||||
tHateEntry *cur = (*iterator);
|
tHateEntry *cur = (*iterator);
|
||||||
|
auto hateEntryPosition = xyz_location(cur->ent->GetX(), cur->ent->GetY(), cur->ent->GetZ());
|
||||||
if(center->IsNPC() && center->CastToNPC()->IsUnderwaterOnly() && zone->HasWaterMap()) {
|
if(center->IsNPC() && center->CastToNPC()->IsUnderwaterOnly() && zone->HasWaterMap()) {
|
||||||
if(!zone->watermap->InLiquid(cur->ent->GetX(), cur->ent->GetY(), cur->ent->GetZ())) {
|
if(!zone->watermap->InLiquid(hateEntryPosition)) {
|
||||||
skipped_count++;
|
skipped_count++;
|
||||||
++iterator;
|
++iterator;
|
||||||
continue;
|
continue;
|
||||||
|
|||||||
@ -1372,7 +1372,8 @@ void Mob::AI_Process() {
|
|||||||
//we cannot reach our target...
|
//we cannot reach our target...
|
||||||
//underwater stuff only works with water maps in the zone!
|
//underwater stuff only works with water maps in the zone!
|
||||||
if(IsNPC() && CastToNPC()->IsUnderwaterOnly() && zone->HasWaterMap()) {
|
if(IsNPC() && CastToNPC()->IsUnderwaterOnly() && zone->HasWaterMap()) {
|
||||||
if(!zone->watermap->InLiquid(target->GetX(), target->GetY(), target->GetZ())) {
|
auto targetPosition = xyz_location(target->GetX(), target->GetY(), target->GetZ());
|
||||||
|
if(!zone->watermap->InLiquid(targetPosition)) {
|
||||||
Mob *tar = hate_list.GetTop(this);
|
Mob *tar = hate_list.GetTop(this);
|
||||||
if(tar == target) {
|
if(tar == target) {
|
||||||
WipeHateList();
|
WipeHateList();
|
||||||
|
|||||||
@ -1197,12 +1197,14 @@ bool PathManager::NoHazardsAccurate(Map::Vertex From, Map::Vertex To)
|
|||||||
|
|
||||||
if (zone->watermap)
|
if (zone->watermap)
|
||||||
{
|
{
|
||||||
if (zone->watermap->InLiquid(From.x, From.y, From.z) || zone->watermap->InLiquid(To.x, To.y, To.z))
|
auto from = xyz_location(From.x, From.y, From.z);
|
||||||
|
auto to = xyz_location(To.x, To.y, To.z);
|
||||||
|
if (zone->watermap->InLiquid(from) || zone->watermap->InLiquid(to))
|
||||||
{
|
{
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
auto testPointNewZ = xyz_location(TestPoint.x, TestPoint.y, NewZ);
|
||||||
if (zone->watermap->InLiquid(TestPoint.x, TestPoint.y, NewZ))
|
if (zone->watermap->InLiquid(testPointNewZ))
|
||||||
{
|
{
|
||||||
Map::Vertex TestPointWater(TestPoint.x, TestPoint.y, NewZ - 0.5f);
|
Map::Vertex TestPointWater(TestPoint.x, TestPoint.y, NewZ - 0.5f);
|
||||||
Map::Vertex TestPointWaterDest = TestPointWater;
|
Map::Vertex TestPointWaterDest = TestPointWater;
|
||||||
|
|||||||
@ -29,7 +29,7 @@ public:
|
|||||||
virtual bool InWater(const xyz_location& location) const { return false; }
|
virtual bool InWater(const xyz_location& location) const { return false; }
|
||||||
virtual bool InVWater(const xyz_location& location) const { return false; }
|
virtual bool InVWater(const xyz_location& location) const { return false; }
|
||||||
virtual bool InLava(const xyz_location& location) const { return false; }
|
virtual bool InLava(const xyz_location& location) const { return false; }
|
||||||
virtual bool InLiquid(float y, float x, float z) const { return false; }
|
virtual bool InLiquid(const xyz_location& location) const { return false; }
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
virtual bool Load(FILE *fp) { return false; }
|
virtual bool Load(FILE *fp) { return false; }
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user