@@ -494,6 +494,57 @@ func TestRegisterStaticActorCombatProfileRejectsInvalidDeathReward(t *testing.T)
494494 }
495495}
496496
497+ func TestRegisterStaticActorCombatProfileAcceptsRewardCarrierMaximums (t * testing.T ) {
498+ const profile = "practice_reward_carrier_max_wolf"
499+ const maxPointCarrier = uint64 (^ uint32 (0 ) >> 1 )
500+ if ! RegisterStaticActorCombatProfile (profile , StaticActorCombatProfileDefaults {
501+ MaxHP : 24 ,
502+ DamagePerNormalAttack : 3 ,
503+ RespawnDelay : PracticeMobBootstrapRespawnDelay ,
504+ DeathReward : StaticActorDeathReward {
505+ Experience : maxPointCarrier ,
506+ Gold : maxPointCarrier ,
507+ },
508+ }) {
509+ t .Fatalf ("expected %q profile registration with point-carrier maximum reward scalars to succeed" , profile )
510+ }
511+ t .Cleanup (func () { UnregisterStaticActorCombatProfileForTest (profile ) })
512+
513+ reward , ok := BootstrapStaticActorDeathReward (profile )
514+ if ! ok {
515+ t .Fatalf ("expected registered reward profile death reward to resolve" )
516+ }
517+ if reward .Experience != maxPointCarrier || reward .Gold != maxPointCarrier {
518+ t .Fatalf ("expected point-carrier maximum reward scalars to round-trip, got %+v" , reward )
519+ }
520+ }
521+
522+ func TestRegisterStaticActorCombatProfileRejectsRewardScalarsAbovePointCarrier (t * testing.T ) {
523+ const maxPointCarrier = uint64 (^ uint32 (0 ) >> 1 )
524+ for _ , tt := range []struct {
525+ name string
526+ reward StaticActorDeathReward
527+ }{
528+ {name : "experience" , reward : StaticActorDeathReward {Experience : maxPointCarrier + 1 }},
529+ {name : "gold" , reward : StaticActorDeathReward {Gold : maxPointCarrier + 1 }},
530+ } {
531+ t .Run (tt .name , func (t * testing.T ) {
532+ profile := "practice_reward_overflow_" + tt .name
533+ if RegisterStaticActorCombatProfile (profile , StaticActorCombatProfileDefaults {
534+ MaxHP : 24 ,
535+ DamagePerNormalAttack : 3 ,
536+ RespawnDelay : PracticeMobBootstrapRespawnDelay ,
537+ DeathReward : tt .reward ,
538+ }) {
539+ t .Fatalf ("expected %q profile registration with overflowing %s reward to fail closed" , profile , tt .name )
540+ }
541+ if ValidStaticActorCombatProfile (profile ) {
542+ t .Fatalf ("expected rejected reward-overflow profile %q not to become valid" , profile )
543+ }
544+ })
545+ }
546+ }
547+
497548func TestRegisterStaticActorCombatProfileRejectsDuplicateDeathRewardDropsBeforeCloneNormalization (t * testing.T ) {
498549 const profile = "practice_duplicate_reward_wolf"
499550 if RegisterStaticActorCombatProfile (profile , StaticActorCombatProfileDefaults {
0 commit comments