Movement will now be handled by the movement manager instead of mob

This commit is contained in:
KimLS
2018-09-20 16:14:47 -07:00
parent f754cb1307
commit 7278c6294d
32 changed files with 323 additions and 306 deletions
+11 -12
View File
@@ -427,7 +427,7 @@ Mob::Mob(const char* in_name,
m_TargetRing = glm::vec3();
flymode = FlyMode3;
flymode = GravityBehavior::Ground;
DistractedFromGrid = false;
hate_list.SetHateOwner(this);
@@ -1167,7 +1167,7 @@ void Mob::FillSpawnStruct(NewSpawn_Struct* ns, Mob* ForWho)
ns->spawn.flymode = flymode;
if(IsBoat()) {
ns->spawn.flymode = 1;
ns->spawn.flymode = GravityBehavior::Floating;
}
ns->spawn.lastName[0] = '\0';
@@ -3566,17 +3566,9 @@ bool Mob::EntityVariableExists(const char *id)
return false;
}
void Mob::SetFlyMode(uint8 flymode)
void Mob::SetFlyMode(GravityBehavior flymode)
{
if(IsClient() && flymode >= 0 && flymode < 3)
{
this->SendAppearancePacket(AT_Levitate, flymode);
}
else if(IsNPC() && flymode >= 0 && flymode <= 3)
{
this->SendAppearancePacket(AT_Levitate, flymode);
this->CastToNPC()->SetFlyMode(flymode);
}
this->flymode = flymode;
}
bool Mob::IsNimbusEffectActive(uint32 nimbus_effect)
@@ -6014,6 +6006,13 @@ float Mob::GetDefaultRaceSize() const {
return GetRaceGenderDefaultHeight(race, gender);
}
void Mob::TryFixZ(int32 z_find_offset, bool fix_client_z)
{
if (fix_z_timer.Check() && flymode == GravityBehavior::Ground) {
FixZ();
}
}
#ifdef BOTS
bool Mob::JoinHealRotationTargetPool(std::shared_ptr<HealRotation>* heal_rotation)