Core/AreaTriggers: Remove unused fields from AreaTriggerCreateProperties and merge movement data into a variant
Port From (https://github.com/TrinityCore/TrinityCore/commit/b6acd368e0bca632d8742c9b5d0ef7f385cf1318)
This commit is contained in:
@@ -157,7 +157,7 @@ namespace Game.DataStorage
|
||||
|
||||
uint ValidateAndSetCurve(uint value)
|
||||
{
|
||||
if (value != 0 && !CliDB.CurveStorage.ContainsKey(value))
|
||||
if (value != 0 && !CliDB.CurveStorage.HasRecord(value))
|
||||
{
|
||||
Log.outError(LogFilter.Sql, $"Table `areatrigger_create_properties` has listed AreaTrigger (Id: {areaTriggerId.Id}, IsCustom: {areaTriggerId.IsCustom}) for AreaTriggerCreatePropertiesId (Id: {createPropertiesId.Id}, IsCustom: {createPropertiesId.IsCustom}) with invalid Curve ({value}), set to 0!");
|
||||
return 0;
|
||||
@@ -215,7 +215,9 @@ namespace Game.DataStorage
|
||||
createProperties.Shape.PolygonVerticesTarget.Clear();
|
||||
}
|
||||
|
||||
createProperties.SplinePoints = splinesByCreateProperties[createProperties.Id];
|
||||
var spline = splinesByCreateProperties.LookupByKey(createProperties.Id);
|
||||
if (spline != null)
|
||||
createProperties.SplinePoints = spline;
|
||||
|
||||
_areaTriggerCreateProperties[createProperties.Id] = createProperties;
|
||||
}
|
||||
@@ -256,7 +258,6 @@ namespace Game.DataStorage
|
||||
return value;
|
||||
}
|
||||
|
||||
|
||||
orbitInfo.Radius = ValidateAndSetFloat(circularMovementInfos.Read<float>(3));
|
||||
orbitInfo.BlendFromRadius = circularMovementInfos.Read<float>(4);
|
||||
orbitInfo.InitialAngle = circularMovementInfos.Read<float>(5);
|
||||
@@ -327,7 +328,7 @@ namespace Game.DataStorage
|
||||
continue;
|
||||
}
|
||||
|
||||
if (createProperties.HasSplines())
|
||||
if (createProperties.SplinePoints != null)
|
||||
{
|
||||
Log.outError(LogFilter.Sql, $"Table `areatrigger` has listed AreaTriggerCreatePropertiesId (Id: {createPropertiesId.Id}, IsCustom: {createPropertiesId.IsCustom}) with splines");
|
||||
continue;
|
||||
|
||||
Reference in New Issue
Block a user