Compare commits
1 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
ba2091d6f9 |
@@ -24,6 +24,8 @@ namespace MxValheim.KillFeed
|
|||||||
ZNet zn = new ZNet();
|
ZNet zn = new ZNet();
|
||||||
if (zn.IsDedicated()) return;
|
if (zn.IsDedicated()) return;
|
||||||
|
|
||||||
|
if (attacker == "The World") return;
|
||||||
|
|
||||||
string finalMsg = (type == 1) ? $"<color=#FF3333>☠</color> {victim} a été tué par {attacker}" :
|
string finalMsg = (type == 1) ? $"<color=#FF3333>☠</color> {victim} a été tué par {attacker}" :
|
||||||
(type == 2) ? $"{attacker} a tué {victim}" :
|
(type == 2) ? $"{attacker} a tué {victim}" :
|
||||||
$"{attacker} a tué {victim}";
|
$"{attacker} a tué {victim}";
|
||||||
|
|||||||
@@ -19,7 +19,7 @@ public class MxValheimMod : BaseUnityPlugin
|
|||||||
|
|
||||||
private const string ModGUID = "ovh.mxdev.mxvalheim";
|
private const string ModGUID = "ovh.mxdev.mxvalheim";
|
||||||
private const string ModName = "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<bool> Config_Locked;
|
||||||
public static ConfigEntry<int> Config_OreMultiplier;
|
public static ConfigEntry<int> Config_OreMultiplier;
|
||||||
|
|||||||
@@ -13,19 +13,26 @@ namespace MxValheim.Patch
|
|||||||
{
|
{
|
||||||
static void Postfix(Door __instance, Humanoid character, bool hold, bool alt, ZNetView ___m_nview)
|
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 (hold || alt || ___m_nview == null || !___m_nview.IsValid()) return;
|
if (nview != null && nview.IsValid())
|
||||||
// Prevent closing of swamp iron gate
|
|
||||||
if (prefabName == "piece_crypt_door") return;
|
|
||||||
|
|
||||||
// Get state: 0 is closed
|
|
||||||
int state = ___m_nview.GetZDO().GetInt("state");
|
|
||||||
|
|
||||||
if (state != 0)
|
|
||||||
{
|
{
|
||||||
// Start coroutine on the door object itself
|
// Get the prefab hash and look up the name in the master list
|
||||||
__instance.StartCoroutine(CloseDoorAfterDelay(__instance, ___m_nview));
|
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;
|
||||||
|
|
||||||
|
// Get state: 0 is closed
|
||||||
|
int state = ___m_nview.GetZDO().GetInt("state");
|
||||||
|
|
||||||
|
if (state != 0)
|
||||||
|
{
|
||||||
|
// Start coroutine on the door object itself
|
||||||
|
__instance.StartCoroutine(CloseDoorAfterDelay(__instance, ___m_nview));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user