@@ -475,3 +475,33 @@ func TestMapIndexStaticActorSnapshotsCloneDeathRewardDropVnums(t *testing.T) {
475475 t .Fatalf ("expected static actor reward snapshots to be isolated from callers, got %+v" , actors [0 ].DeathReward .DropVnums )
476476 }
477477}
478+
479+ func TestMapIndexStaticActorLookupClonesDeathRewardDropVnumsWhenEntityIndexIsMissing (t * testing.T ) {
480+ index := NewMapIndex (NewBootstrapTopology (0 ))
481+ guard := StaticEntity {
482+ Entity : Entity {ID : 12 , Kind : EntityKindStaticActor , Name : "PracticeMob" },
483+ Position : NewPosition (42 , 1700 , 2800 ),
484+ RaceNum : 20300 ,
485+ CombatProfile : StaticActorCombatProfilePracticeMob ,
486+ SpawnGroupRef : "practice.mob_delta" ,
487+ DeathReward : StaticActorDeathReward {Experience : 75 , Gold : 60 , DropVnums : []uint32 {27001 , 27002 }},
488+ }
489+ if ! index .RegisterStatic (guard ) {
490+ t .Fatal ("expected static actor registration to succeed" )
491+ }
492+ delete (index .staticByEntityID , guard .Entity .ID )
493+
494+ lookup , ok := index .StaticActor (guard .Entity .ID )
495+ if ! ok {
496+ t .Fatal ("expected static actor lookup through surviving map bucket to succeed" )
497+ }
498+ lookup .DeathReward .DropVnums [0 ] = 99999
499+
500+ lookup , ok = index .StaticActor (guard .Entity .ID )
501+ if ! ok {
502+ t .Fatal ("expected second static actor lookup through surviving map bucket to succeed" )
503+ }
504+ if len (lookup .DeathReward .DropVnums ) != 2 || lookup .DeathReward .DropVnums [0 ] != 27001 || lookup .DeathReward .DropVnums [1 ] != 27002 {
505+ t .Fatalf ("expected static actor lookup to clone reward drops from surviving map bucket, got %+v" , lookup .DeathReward .DropVnums )
506+ }
507+ }
0 commit comments