diff --git a/src/MHServerEmu.Games/Network/MigrationUtility.cs b/src/MHServerEmu.Games/Network/MigrationUtility.cs index e642fd89..6bbfb56b 100644 --- a/src/MHServerEmu.Games/Network/MigrationUtility.cs +++ b/src/MHServerEmu.Games/Network/MigrationUtility.cs @@ -1,7 +1,9 @@ using Gazillion; +using MHServerEmu.Core.Memory; using MHServerEmu.Core.Serialization; using MHServerEmu.DatabaseAccess.Models; using MHServerEmu.Games.Entities; +using MHServerEmu.Games.Entities.Avatars; using MHServerEmu.Games.GameData; using MHServerEmu.Games.GameData.Prototypes; using MHServerEmu.Games.Properties; @@ -54,7 +56,25 @@ namespace MHServerEmu.Games.Network { List<(ulong, ulong)> propertyList = migrationData.GetOrCreatePropertyList(entity.DatabaseUniqueId); propertyList.Clear(); - entity.Properties.GetPropertiesForMigration(propertyList); + + // HACK: Ugly property hack, remove this when we figure out an efficient way to migrate runtime-only conditions. + PropertyEnum propertyToIgnore = PropertyEnum.Invalid; + + if (entity is Avatar) + { + switch ((AvatarPrototypeId)entity.PrototypeDataRef) + { + case AvatarPrototypeId.AntMan: + propertyToIgnore = PropertyEnum.SecondaryResource + break; + + case AvatarPrototypeId.HumanTorch: + propertyToIgnore = PropertyEnum.Endurance; + break; + } + } + + entity.Properties.GetPropertiesForMigration(propertyList, propertyToIgnore); } private static void RestoreProperties(MigrationData migrationData, Entity entity) diff --git a/src/MHServerEmu.Games/Properties/PropertyCollection.cs b/src/MHServerEmu.Games/Properties/PropertyCollection.cs index 7cb4205f..f2d077d4 100644 --- a/src/MHServerEmu.Games/Properties/PropertyCollection.cs +++ b/src/MHServerEmu.Games/Properties/PropertyCollection.cs @@ -844,7 +844,7 @@ namespace MHServerEmu.Games.Properties return success; } - public void GetPropertiesForMigration(List<(ulong, ulong)> propertyList) + public void GetPropertiesForMigration(List<(ulong, ulong)> propertyList, PropertyEnum propertyToIgnore = PropertyEnum.Invalid) { PropertyEnum prevProperty = PropertyEnum.Invalid; PropertyInfoPrototype propInfoProto = null; @@ -860,9 +860,9 @@ namespace MHServerEmu.Games.Properties prevProperty = propertyEnum; } - // HACK: Do not migrate mana because we don't migrate conditions, which can cause some heroes to get stuck in bad state (e.g. Human Torch). + // HACK: Do not migrate some properties because we don't migrate conditions, which can cause some heroes to get stuck in bad state (e.g. Human Torch, Ant-Man). // This can be removed if we ever start migrating runtime-only conditions. - if (propertyEnum == PropertyEnum.Endurance) + if (propertyEnum == propertyToIgnore) continue; // Migrate properties that are not saved to the database, but are supposed to be replicated for transfer