diff --git a/HarmonySrc/Possession.cs b/HarmonySrc/Possession.cs index 8a87b55..c3160f1 100644 --- a/HarmonySrc/Possession.cs +++ b/HarmonySrc/Possession.cs @@ -942,6 +942,7 @@ namespace NecromancerTome { _carrionBlocks.Remove(pos); _world.SetBlocksRPC(new List { new BlockChangeInfo(pos, BlockValue.Air, MarchingCubes.DensityAir) }); + LogCarrionLeft(_world, pos); } Debug.Log("[NecromancerTome] Possession: падаль " + what + " исчезла"); } @@ -979,6 +980,26 @@ namespace NecromancerTome ", мяса у падали " + Mathf.CeilToInt(EatMeat(0f))); } + /// Диагностика (тест 13.10: «останки визуально не исчезли» после «доедено»): что стоит на месте съеденного + /// блока сразу после замены и какие блоки падали остались в 2 блоках вокруг - одна куча может быть из нескольких. + static void LogCarrionLeft(World _world, Vector3i _pos) + { + string near = ""; + for (int x = -2; x <= 2; x++) + for (int y = -2; y <= 2; y++) + for (int z = -2; z <= 2; z++) + { + Vector3i p = new Vector3i(_pos.x + x, _pos.y + y, _pos.z + z); + BlockValue bv = _world.GetBlock(p); + if (!bv.isair && IsCarrionBlock(bv.type)) + { + near += " " + bv.Block.GetBlockName() + (bv.ischild ? "(часть)" : "") + "@" + p; + } + } + Debug.Log("[NecromancerTome] Possession: после еды на " + _pos + " - " + _world.GetBlock(_pos).Block.GetBlockName() + + ", падаль рядом:" + (near.Length > 0 ? near : " нет")); + } + /// Запас мяса текущей падали плюс _delta; первый укус - запас с нуля: у трупа - полное /// здоровье при жизни, у блока - его прочность (MaxDamage минус уже нанесённый урон). static float EatMeat(float _delta)