1 Commits
1.5.0 ... 1.5.1

Author SHA1 Message Date
mikx
ba2091d6f9 (1.5.1) KillFeed World Fix + Auto Door Fix 2026-02-04 15:51:00 -05:00
3 changed files with 22 additions and 13 deletions

View File

@@ -24,6 +24,8 @@ namespace MxValheim.KillFeed
ZNet zn = new ZNet();
if (zn.IsDedicated()) return;
if (attacker == "The World") return;
string finalMsg = (type == 1) ? $"<color=#FF3333>☠</color> {victim} a été tué par {attacker}" :
(type == 2) ? $"{attacker} a tué {victim}" :
$"{attacker} a tué {victim}";

View File

@@ -19,7 +19,7 @@ public class MxValheimMod : BaseUnityPlugin
private const string ModGUID = "ovh.mxdev.mxvalheim";
private const string ModName = "MxValheim";
private const string ModVersion = "1.5.0";
private const string ModVersion = "1.5.1";
public static ConfigEntry<bool> Config_Locked;
public static ConfigEntry<int> Config_OreMultiplier;

View File

@@ -13,11 +13,17 @@ namespace MxValheim.Patch
{
static void Postfix(Door __instance, Humanoid character, bool hold, bool alt, ZNetView ___m_nview)
{
string prefabName = ___m_nview.GetPrefabName();
ZNetView nview = __instance.GetComponent<ZNetView>();
if (nview != null && nview.IsValid())
{
// Get the prefab hash and look up the name in the master list
int prefabHash = nview.GetZDO().GetPrefab();
string prefabName = ZNetScene.instance.GetPrefab(prefabHash).name;
if (prefabName == "piece_crypt_door") return;
if (hold || alt || ___m_nview == null || !___m_nview.IsValid()) return;
// Prevent closing of swamp iron gate
if (prefabName == "piece_crypt_door") return;
// Get state: 0 is closed
int state = ___m_nview.GetZDO().GetInt("state");
@@ -28,6 +34,7 @@ namespace MxValheim.Patch
__instance.StartCoroutine(CloseDoorAfterDelay(__instance, ___m_nview));
}
}
}
static IEnumerator CloseDoorAfterDelay(Door door, ZNetView nview)
{