Core/Instances: Instance lock rewrite (WIP)

Port From (https://github.com/TrinityCore/TrinityCore/commit/17665c929c3a9fb7fe75dd680648129bc1c1f874)
This commit is contained in:
hondacrx
2022-10-04 10:00:07 -04:00
parent d21624fd87
commit d3dde761a2
27 changed files with 907 additions and 431 deletions
-16
View File
@@ -103,22 +103,6 @@ namespace Game.Chat
}
}
// if the player or the player's group is bound to another instance
// the player will not be bound to another one
InstanceBind bind = _player.GetBoundInstance(target.GetMapId(), target.GetDifficultyID(map.GetEntry()));
if (bind == null)
{
Group group = _player.GetGroup();
// if no bind exists, create a solo bind
InstanceBind gBind = group ? group.GetBoundInstance(target) : null; // if no bind exists, create a solo bind
if (gBind == null)
{
InstanceSave save = Global.InstanceSaveMgr.GetInstanceSave(target.GetInstanceId());
if (save != null)
_player.BindToInstance(save, !save.CanReset());
}
}
if (map.IsRaid())
{
_player.SetRaidDifficultyID(target.GetRaidDifficultyID());
+1 -1
View File
@@ -334,7 +334,7 @@ namespace Game.Chat
if (player == null)
return false;
DB.World.EscapeString(ref normalizedName);
WorldDatabase.EscapeString(ref normalizedName);
SQLResult result = DB.World.Query($"SELECT c.position_x, c.position_y, c.position_z, c.orientation, c.map, ct.name FROM creature c INNER JOIN creature_template ct ON c.id = ct.entry WHERE ct.name LIKE '{normalizedName}'");
if (result.IsEmpty())