minor bugfix and pad support

This commit is contained in:
Ferdinando 2026-09-12 10:42:01 +02:00
commit 6e87be3c77
21 changed files with 574 additions and 85 deletions

View file

@ -234,8 +234,11 @@ namespace RacesOfValheim
{
if (fermenter == null || GetContentMethod == null) return false;
string content = GetContentMethod.Invoke(fermenter, null) as string;
return content == BaseName || content == SuperiorBaseName;
// Valheim 1.0: GetContent returns the stable hash of the prefab name, not the name. The old
// "as string" read null for every barrel and the speed-up silently stopped.
int content = System.Convert.ToInt32(GetContentMethod.Invoke(fermenter, null));
return content != 0
&& (content == BaseName.GetStableHashCode() || content == SuperiorBaseName.GetStableHashCode());
}
private static Player.Food MakeFood(ItemDrop drop, GameObject prefab, string prefabName)