Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixing compile and patch errors introduced via v0.214.2 #793

Closed
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
## How to setup your environment for V+ development
How to setup the development enviroment to compile ValheimPlus yourself.

1. Download the [BepInEx for Valheim package](https://valheim.thunderstore.io/package/download/denikson/BepInExPack_Valheim/5.4.1901/).
1. Download the [BepInEx for Valheim package](https://valheim.thunderstore.io/package/download/denikson/BepInExPack_Valheim/5.4.2100/).
- Extract zip contents and copy the contents inside `/BepInExPack_Valheim/` and paste them in your Valheim root folder and overwrite every file when asked.
- This package sets up your Valheim game with BepInEx configurations specifically for mod devs. Created by [BepInEx](https://github.com/BepInEx).
1. Copy over all the DLLs from Valheim/unstripped_corlib to Valheim/valheim_Data/Managed *(overwrite when asked)*
Expand Down
8 changes: 4 additions & 4 deletions ValheimPlus/GameClasses/Chat.cs
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,10 @@ namespace ValheimPlus.GameClasses
/// <summary>
/// Change Ping and global message behavior
/// </summary>
[HarmonyPatch(typeof(Chat), nameof(Chat.OnNewChatMessage), new System.Type[] { typeof(GameObject), typeof(long), typeof(Vector3), typeof(Talker.Type), typeof(string), typeof(string), typeof(string) })]
[HarmonyPatch(typeof(Chat), nameof(Chat.OnNewChatMessage), new System.Type[] { typeof(GameObject), typeof(long), typeof(Vector3), typeof(Talker.Type), typeof(UserInfo), typeof(string), typeof(string) })]
public static class Chat_AddInworldText_Patch
{
private static bool Prefix(ref Chat __instance, GameObject go, long senderID, Vector3 pos, Talker.Type type, string user, string text, string senderNetworkUserId)
private static bool Prefix(ref Chat __instance, GameObject go, long senderID, Vector3 pos, Talker.Type type, UserInfo user, string text, string senderNetworkUserId)
{

if (Configuration.Current.Chat.IsEnabled)
Expand Down Expand Up @@ -50,7 +50,7 @@ private static bool Prefix(ref Chat __instance, GameObject go, long senderID, Ve
{
// Only add string to chat window and show no ping
if (Configuration.Current.Chat.outOfRangeShoutsDisplayInChatWindow)
__instance.AddString(user, text, Talker.Type.Shout);
__instance.AddString(user.GetDisplayName(senderNetworkUserId), text, Talker.Type.Shout);
return false;
}
}
Expand All @@ -64,7 +64,7 @@ private static bool Prefix(ref Chat __instance, GameObject go, long senderID, Ve



[HarmonyPatch(typeof(Chat), nameof(Chat.AddInworldText), new System.Type[] { typeof(GameObject), typeof(long), typeof(Vector3), typeof(Talker.Type), typeof(string), typeof(string) })]
[HarmonyPatch(typeof(Chat), nameof(Chat.AddInworldText), new System.Type[] { typeof(GameObject), typeof(long), typeof(Vector3), typeof(Talker.Type), typeof(UserInfo), typeof(string) })]
public static class Chat_AddInworldText_Transpiler
{
/// <summary>
Expand Down
5 changes: 3 additions & 2 deletions ValheimPlus/GameClasses/InventoryGUI.cs
Original file line number Diff line number Diff line change
Expand Up @@ -261,7 +261,8 @@ public static IEnumerable<CodeInstruction> Transpile(IEnumerable<CodeInstruction

private static ItemDrop.ItemData GetFirstRequiredItemFromInventoryOrChest(Player player, Recipe recipe, int quality, out int quantity)
{
ItemDrop.ItemData found = player.GetFirstRequiredItem(player.GetInventory(), recipe, quality, out quantity);
int extraAmount;
ItemDrop.ItemData found = player.GetFirstRequiredItem(player.GetInventory(), recipe, quality, out quantity, out extraAmount);
if (found != null) return found;

GameObject pos = player.GetCurrentCraftingStation()?.gameObject;
Expand All @@ -271,7 +272,7 @@ private static ItemDrop.ItemData GetFirstRequiredItemFromInventoryOrChest(Player

foreach (Container chest in nearbyChests)
{
found = player.GetFirstRequiredItem(chest.GetInventory(), recipe, quality, out quantity);
found = player.GetFirstRequiredItem(chest.GetInventory(), recipe, quality, out quantity, out extraAmount);
if (found != null)
{
return found;
Expand Down