Fixes creatures moving to different cells/grids, Some work on fixing pets.

This commit is contained in:
hondacrx
2024-03-13 23:35:24 -04:00
parent b3d880c115
commit 5a2ef185c4
3 changed files with 7 additions and 4 deletions
+6 -1
View File
@@ -4622,12 +4622,15 @@ namespace Game.Entities
if (duration > 0)
pet.SetDuration(duration);
return null;
return pet;
}
// petentry == 0 for hunter "call pet" (current pet summoned if any)
if (entry == 0)
{
pet.Dispose();
return null;
}
// only SUMMON_PET are handled here
@@ -4636,6 +4639,7 @@ namespace Game.Entities
{
Log.outError(LogFilter.Server, "Pet (guidlow {0}, entry {1}) not summoned. Suggested coordinates isn't valid (X: {2} Y: {3})",
pet.GetGUID().ToString(), pet.GetEntry(), pet.GetPositionX(), pet.GetPositionY());
pet.Dispose();
return null;
}
@@ -4644,6 +4648,7 @@ namespace Game.Entities
if (!pet.Create(map.GenerateLowGuid(HighGuid.Pet), map, entry, petNumber))
{
Log.outError(LogFilter.Server, "no such creature entry {0}", entry);
pet.Dispose();
return null;
}
+1 -1
View File
@@ -1176,7 +1176,7 @@ namespace Game.Maps
}
creature._moveState = ObjectCellMoveState.None;
if (creature.IsInWorld)
if (!creature.IsInWorld)
continue;
// do move or do move to respawn or remove creature if previous all fail
@@ -208,8 +208,6 @@ namespace Game.Movement
return _abstractFollower.GetTarget();
}
public override MovementGeneratorType GetMovementGeneratorType() { return MovementGeneratorType.Follow; }
public override void UnitSpeedChanged() { _lastTargetPosition = null; }