fix #203: preserve animation on appearance updates

This commit is contained in:
Erik 2026-07-11 00:25:29 +02:00
parent ff06aa3107
commit c7607f019c
9 changed files with 237 additions and 22 deletions

View file

@ -232,13 +232,11 @@ public class EntityClassificationCacheTests
}
[Fact]
public void DespawnRespawn_UnderReusedId_RepopulatesFresh()
public void InvalidateRepopulate_UnderReusedId_RepopulatesFresh()
{
// Pins the audit's ObjDescEvent contract (audit section 1):
// ObjDescEvent is despawn + respawn (with a NEW local entity.Id),
// never an in-place mutation. Even when an id IS reused
// (theoretical — _liveEntityIdCounter is monotonic in practice),
// the cache must serve fresh data after invalidation.
// Appearance updates preserve the entity Id and invalidate this cache
// before the updated MeshRefs are classified. This lower-level test
// pins invalidate-then-repopulate behavior for any reused Id.
var cache = new EntityClassificationCache();
var batchesV1 = new[] { MakeCachedBatch(1, 0, 6, 0xAA) };
var batchesV2 = new[] { MakeCachedBatch(2, 6, 12, 0xCC) };