0
0
mirror of https://github.com/sp-tarkov/modules.git synced 2025-02-13 09:50:43 -05:00

Add additional logging to patch

This commit is contained in:
Dev 2024-01-04 09:25:42 +00:00
parent 2878279ce9
commit ae2b98b69e

View File

@ -25,7 +25,12 @@ namespace Aki.Custom.Patches
_locationProperty = localGameBaseType.GetProperties(PatchConstants.PrivateFlags).Single(x => x.PropertyType == typeof(Location));
// Find the TimeAndWeatherSettings handling method
return localGameBaseType.GetMethods(PatchConstants.PrivateFlags).SingleOrDefault(IsTargetMethod);
var desiredMethod = localGameBaseType.GetMethods(PatchConstants.PrivateFlags).SingleOrDefault(m => IsTargetMethod(m));
Logger.LogDebug($"{GetType().Name} Type: {localGameBaseType?.Name}");
Logger.LogDebug($"{GetType().Name} Method: {desiredMethod?.Name}");
return desiredMethod;
}
private static bool IsTargetMethod(MethodInfo mi)
@ -48,6 +53,8 @@ namespace Aki.Custom.Patches
Location location = _locationProperty.GetValue(__instance) as Location;
gameWorld.LocationId = location.Id;
Logger.LogDebug($"[SetLocationId] Set locationId to: {location.Id}");
}
}
}