Upload from upload_mods.ps1
This commit is contained in:
22
Score/Fire/Harmony/ChunkSetBlock.cs
Normal file
22
Score/Fire/Harmony/ChunkSetBlock.cs
Normal file
@@ -0,0 +1,22 @@
|
||||
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);
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user