Fixed QuestBundle_Event_Galileo stages

This commit is contained in:
MaikyM 2019-12-14 16:54:02 -06:00
parent 8b66257ca7
commit c7515452c2
2 changed files with 22 additions and 2 deletions

View File

@ -271,8 +271,28 @@ namespace FModel.Methods.Assets.IconCreator.ChallengeID
JToken primaryAssetNameToken = token["struct_type"]["properties"][0]["tag_data"]["struct_type"]["properties"][1]["tag_data"];
if (primaryAssetNameToken != null)
{
string primaryAssetName = primaryAssetNameToken.Value<string>();
// Manual fix: QuestBundle_Event_Galileo Stages
if (assetPath.StartsWith("/FortniteGame/Content/Athena/Items/Quests/BattlePass/Season11/Galileo/"))
{
JArray objectivesGalileoArray = AssetsUtility.GetPropertyTagText<JArray>(AssetProperties, "Objectives", "data");
if (objectivesGalileoArray != null)
{
JToken questGalileoToken = objectivesGalileoArray[0]["struct_type"]["properties"][0]["tag_data"];
if (questGalileoToken != null)
{
if (!string.Equals(primaryAssetName, questGalileoToken.Value<string>()))
{
int questGalileoStageId = int.Parse(questGalileoToken.Value<string>().Substring(questGalileoToken.Value<string>().Length - 1, 1)) + 1;
primaryAssetName = questGalileoToken.Value<string>().Remove(questGalileoToken.Value<string>().Length - 1).Replace("questobj", "quest") + "_" + questGalileoStageId;
}
}
}
}
//this will catch the full path if asset exists to be able to grab his PakReader and List<FPakEntry>
string primaryAssetNameFullPath = AssetEntries.AssetEntriesDict.Where(x => x.Key.Contains("/" + primaryAssetNameToken.Value<string>())).Select(d => d.Key).FirstOrDefault();
string primaryAssetNameFullPath = AssetEntries.AssetEntriesDict.Where(x => x.Key.Contains("/" + primaryAssetName)).Select(d => d.Key).FirstOrDefault();
if (!string.IsNullOrEmpty(primaryAssetNameFullPath))
{
// Prevents loops

View File

@ -494,7 +494,7 @@ namespace FModel.Methods.Utilities
AssetMainToken = AssetData;
}
return !string.IsNullOrEmpty(AssetMainToken.ToString()) ? AssetMainToken : null;
return AssetMainToken != null && !string.IsNullOrEmpty(AssetMainToken.ToString()) ? AssetMainToken : null;
}
public static T GetPropertyTag<T>(JArray properties, string name)