mirror of
https://github.com/EQEmu/Server.git
synced 2026-06-13 15:08:22 +00:00
Switched out our kinda juryrigged vector types for glm::vec types since we use that as a 3d math library already but never switched out the types
This commit is contained in:
+17
-17
@@ -1839,7 +1839,7 @@ void command_itemtest(Client *c, const Seperator *sep)
|
||||
void command_gassign(Client *c, const Seperator *sep)
|
||||
{
|
||||
if (sep->IsNumber(1) && c->GetTarget() && c->GetTarget()->IsNPC())
|
||||
database.AssignGrid(c, c->GetTarget()->CastToNPC()->m_SpawnPoint, atoi(sep->arg[1]));
|
||||
database.AssignGrid(c, glm::vec2(c->GetTarget()->CastToNPC()->m_SpawnPoint), atoi(sep->arg[1]));
|
||||
else
|
||||
c->Message(0,"Usage: #gassign [num] - must have an npc target!");
|
||||
}
|
||||
@@ -2095,7 +2095,7 @@ void command_wp(Client *c, const Seperator *sep)
|
||||
}
|
||||
else {
|
||||
auto position = c->GetPosition();
|
||||
position.m_Heading = -1;
|
||||
position.w = -1;
|
||||
database.AddWP(c, atoi(sep->arg[2]),wp, position, atoi(sep->arg[3]),zone->GetZoneID());
|
||||
}
|
||||
}
|
||||
@@ -4908,7 +4908,7 @@ void command_manaburn(Client *c, const Seperator *sep)
|
||||
c->Message(0, "#Manaburn needs a target.");
|
||||
else {
|
||||
int cur_level=c->GetAA(MANA_BURN);//ManaBurn ID
|
||||
if (ComparativeDistance(c->GetPosition(), target->GetPosition()) > 200)
|
||||
if (DistanceSquared(c->GetPosition(), target->GetPosition()) > 200)
|
||||
c->Message(0,"You are too far away from your target.");
|
||||
else {
|
||||
if(cur_level == 1) {
|
||||
@@ -5440,7 +5440,7 @@ void command_wpadd(Client *c, const Seperator *sep)
|
||||
}
|
||||
auto position = c->GetPosition();
|
||||
if (strcmp("-h",sep->arg[2]) != 0)
|
||||
position.m_Heading = -1;
|
||||
position.w = -1;
|
||||
|
||||
uint32 tmp_grid = database.AddWPForSpawn(c, s2info->GetID(), position, pause, type1, type2, zone->GetZoneID());
|
||||
if (tmp_grid)
|
||||
@@ -6973,7 +6973,7 @@ void command_path(Client *c, const Seperator *sep)
|
||||
|
||||
if(zone->zonemap)
|
||||
{
|
||||
Map::Vertex loc(px, py, pz);
|
||||
glm::vec3 loc(px, py, pz);
|
||||
best_z = zone->zonemap->FindBestZ(loc, nullptr);
|
||||
}
|
||||
else
|
||||
@@ -7000,7 +7000,7 @@ void command_path(Client *c, const Seperator *sep)
|
||||
|
||||
if(zone->zonemap)
|
||||
{
|
||||
Map::Vertex loc(px, py, pz);
|
||||
glm::vec3 loc(px, py, pz);
|
||||
best_z = zone->zonemap->FindBestZ(loc, nullptr);
|
||||
}
|
||||
else
|
||||
@@ -7133,8 +7133,8 @@ void command_path(Client *c, const Seperator *sep)
|
||||
{
|
||||
if(c && c->GetTarget())
|
||||
{
|
||||
if (zone->pathing->NoHazardsAccurate(Map::Vertex(c->GetX(), c->GetY(), c->GetZ()),
|
||||
Map::Vertex(c->GetTarget()->GetX(), c->GetTarget()->GetY(), c->GetTarget()->GetZ())))
|
||||
if (zone->pathing->NoHazardsAccurate(glm::vec3(c->GetX(), c->GetY(), c->GetZ()),
|
||||
glm::vec3(c->GetTarget()->GetX(), c->GetTarget()->GetY(), c->GetTarget()->GetZ())))
|
||||
{
|
||||
c->Message(0, "No hazards.");
|
||||
}
|
||||
@@ -7210,7 +7210,7 @@ void command_path(Client *c, const Seperator *sep)
|
||||
{
|
||||
Mob *m = c->GetTarget();
|
||||
|
||||
Map::Vertex Position(m->GetX(), m->GetY(), m->GetZ());
|
||||
glm::vec3 Position(m->GetX(), m->GetY(), m->GetZ());
|
||||
|
||||
int Node = zone->pathing->FindNearestPathNode(Position);
|
||||
|
||||
@@ -7344,12 +7344,12 @@ void command_bestz(Client *c, const Seperator *sep) {
|
||||
if (zone->zonemap == nullptr) {
|
||||
c->Message(0,"Map not loaded for this zone");
|
||||
} else {
|
||||
Map::Vertex me;
|
||||
glm::vec3 me;
|
||||
me.x = c->GetX();
|
||||
me.y = c->GetY();
|
||||
me.z = c->GetZ() + (c->GetSize() == 0.0 ? 6 : c->GetSize()) * HEAD_POSITION;
|
||||
Map::Vertex hit;
|
||||
Map::Vertex bme(me);
|
||||
glm::vec3 hit;
|
||||
glm::vec3 bme(me);
|
||||
bme.z -= 500;
|
||||
|
||||
float best_z = zone->zonemap->FindBestZ(me, &hit);
|
||||
@@ -7372,7 +7372,7 @@ void command_bestz(Client *c, const Seperator *sep) {
|
||||
|
||||
if(c->GetTarget()) {
|
||||
z=c->GetTarget()->GetZ();
|
||||
auto position = xyz_location(c->GetTarget()->GetX(), c->GetTarget()->GetY(), z);
|
||||
auto position = glm::vec3(c->GetTarget()->GetX(), c->GetTarget()->GetY(), z);
|
||||
RegionType = zone->watermap->ReturnRegionType(position);
|
||||
c->Message(0,"InWater returns %d", zone->watermap->InWater(position));
|
||||
c->Message(0,"InLava returns %d", zone->watermap->InLava(position));
|
||||
@@ -7380,7 +7380,7 @@ void command_bestz(Client *c, const Seperator *sep) {
|
||||
}
|
||||
else {
|
||||
z=c->GetZ();
|
||||
auto position = xyz_location(c->GetX(), c->GetY(), z);
|
||||
auto position = glm::vec3(c->GetX(), c->GetY(), z);
|
||||
RegionType = zone->watermap->ReturnRegionType(position);
|
||||
c->Message(0,"InWater returns %d", zone->watermap->InWater(position));
|
||||
c->Message(0,"InLava returns %d", zone->watermap->InLava(position));
|
||||
@@ -10305,7 +10305,7 @@ void command_disarmtrap(Client *c, const Seperator *sep)
|
||||
{
|
||||
if(c->HasSkill(SkillDisarmTraps))
|
||||
{
|
||||
if(ComparativeDistanceNoZ(c->GetPosition(), target->GetPosition()) > RuleI(Adventure, LDoNTrapDistanceUse))
|
||||
if(DistanceSquaredNoZ(c->GetPosition(), target->GetPosition()) > RuleI(Adventure, LDoNTrapDistanceUse))
|
||||
{
|
||||
c->Message(13, "%s is too far away.", target->GetCleanName());
|
||||
return;
|
||||
@@ -10330,7 +10330,7 @@ void command_sensetrap(Client *c, const Seperator *sep)
|
||||
{
|
||||
if(c->HasSkill(SkillSenseTraps))
|
||||
{
|
||||
if(ComparativeDistanceNoZ(c->GetPosition(), target->GetPosition()) > RuleI(Adventure, LDoNTrapDistanceUse))
|
||||
if(DistanceSquaredNoZ(c->GetPosition(), target->GetPosition()) > RuleI(Adventure, LDoNTrapDistanceUse))
|
||||
{
|
||||
c->Message(13, "%s is too far away.", target->GetCleanName());
|
||||
return;
|
||||
@@ -10355,7 +10355,7 @@ void command_picklock(Client *c, const Seperator *sep)
|
||||
{
|
||||
if(c->HasSkill(SkillPickLock))
|
||||
{
|
||||
if(ComparativeDistanceNoZ(c->GetPosition(), target->GetPosition()) > RuleI(Adventure, LDoNTrapDistanceUse))
|
||||
if(DistanceSquaredNoZ(c->GetPosition(), target->GetPosition()) > RuleI(Adventure, LDoNTrapDistanceUse))
|
||||
{
|
||||
c->Message(13, "%s is too far away.", target->GetCleanName());
|
||||
return;
|
||||
|
||||
Reference in New Issue
Block a user