Upload from upload_mods.ps1
This commit is contained in:
53
Harmony/Harmony_PlayerTracker.cs
Normal file
53
Harmony/Harmony_PlayerTracker.cs
Normal file
@@ -0,0 +1,53 @@
|
||||
using DynamicMusic;
|
||||
using MusicUtils.Enums;
|
||||
using System.Collections.Generic;
|
||||
|
||||
namespace Harmony.PlayerTrackerPatches
|
||||
{
|
||||
[HarmonyPatch(typeof(PlayerTracker))]
|
||||
[HarmonyPatch("determineTrader")]
|
||||
public class determineTraderPatch
|
||||
{
|
||||
public static bool Prefix(PlayerTracker __instance, ref SectionType __result,
|
||||
List<Entity> ___npcs,
|
||||
Vector3 ___boundingBoxRange
|
||||
)
|
||||
{
|
||||
___npcs.Clear();
|
||||
GameManager.Instance.World.GetEntitiesInBounds(typeof(EntityTrader), new Bounds(GameManager.Instance.World.GetPrimaryPlayer().position, ___boundingBoxRange), ___npcs);
|
||||
if (___npcs.Count > 0)
|
||||
{
|
||||
EntityTrader entityTrader = ___npcs[0] as EntityTrader;
|
||||
if (entityTrader != null)
|
||||
{
|
||||
string npcID = entityTrader.npcID;
|
||||
if (npcID == "traitorjoel")
|
||||
{
|
||||
__result = SectionType.TraderJoel;
|
||||
}
|
||||
if (npcID == "traderjen")
|
||||
{
|
||||
__result = SectionType.TraderJen;
|
||||
}
|
||||
if (npcID == "traderbob")
|
||||
{
|
||||
__result = SectionType.TraderBob;
|
||||
}
|
||||
if (npcID == "traderhugh")
|
||||
{
|
||||
__result = SectionType.TraderHugh;
|
||||
}
|
||||
if (npcID == "traderrekt")
|
||||
{
|
||||
__result = SectionType.TraderRekt;
|
||||
}
|
||||
//Log.Warning(entityTrader.npcID + " is not a known trader name to DMS");
|
||||
return false;
|
||||
}
|
||||
}
|
||||
__result = SectionType.None;
|
||||
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user