IsSameFaction read player.m_customData directly, which is local save data never networked - correct only for whichever client is asking, wrong for a remote player as seen by whatever peer owns the mob's ZDO (the common case in multiplayer). Switched to the ZDO-synced race value with the same fallback DraughVisuals/TrentaVisuals already use. Also adds FactionConfig.ShareHostilityWithParty (off by default): when on, a player's truce covers every faction any connected player's race belongs to, not just their own - a Dvergar and an Aswid playing together are left alone by both the Mountain's mobs and the Swamp's.
25 lines
1 KiB
C#
25 lines
1 KiB
C#
using BepInEx.Configuration;
|
|
|
|
namespace RacesOfValheim
|
|
{
|
|
/// <summary>
|
|
/// Tunables for the Factions truce system, bound as BepInEx ConfigEntry - see
|
|
/// CONFIGURATION-MANAGER-HOWTO.md. Bound once, from RacesOfValheim.Awake().
|
|
/// </summary>
|
|
public static class FactionConfig
|
|
{
|
|
public static ConfigEntry<bool> ShareHostilityWithParty;
|
|
|
|
public static void Bind(ConfigFile config)
|
|
{
|
|
const string section = "Factions - Hostility";
|
|
|
|
ShareHostilityWithParty = config.Bind(section, "Share Hostility With Party", false,
|
|
new ConfigDescription(
|
|
"When enabled, a player's truce covers every faction any connected player's race " +
|
|
"belongs to - a Dvergar and an Aswid playing together are both left alone by the " +
|
|
"Mountain's mobs AND the Swamp's, not just their own. When disabled (default), each " +
|
|
"player is only exempted for their own race's faction."));
|
|
}
|
|
}
|
|
}
|