22 lines
695 B
C#
22 lines
695 B
C#
namespace Features.Fire.Harmony
|
|
{
|
|
[HarmonyPatch(typeof(Chunk))]
|
|
[HarmonyPatch("SetBlock")]
|
|
|
|
public class ChunkSetBlock
|
|
{
|
|
public static void Postfix(Chunk __instance, int ___m_X, int ___m_Z, int x, int y, int z, bool _fromReset)
|
|
{
|
|
if (!_fromReset) return;
|
|
// If the POI is being reset, clear the fire.
|
|
var vector3I = new Vector3i((___m_X << 4) + x, y, (___m_Z << 4) + z);
|
|
var fireMap = FireManager.Instance?.GetFireMap();
|
|
if (fireMap == null) return;
|
|
if (fireMap.ContainsKey(vector3I))
|
|
{
|
|
FireManager.Instance?.RemoveFire(vector3I);
|
|
}
|
|
|
|
}
|
|
}
|
|
} |