mirror of
https://github.com/DarkflameUniverse/DarkflameServer.git
synced 2026-11-16 08:45:27 +00:00
fix(destroyable): resurrect only a dead player that isn't already resurrecting
RequestResurrect resurrected whoever sent it, so a living player could reset their health and imagination, and repeated requests stacked respawns. The client's destroyable resurrects only when smashed and not resurrecting (LWODestroyableComponent::SendMessage 0x00d29e40); live, all 17 requests in the captures came after the player's Die and before its Resurrect. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
@@ -718,3 +718,16 @@ TEST_F(DestroyableTest, DamageReductionsAddUp) {
|
||||
destroyableComponent->RemoveDamageReduction(10);
|
||||
EXPECT_EQ(destroyableComponent->GetDamageReduction(), 0);
|
||||
}
|
||||
|
||||
// The client resurrects only a dead object that isn't already resurrecting; a RequestResurrect from a living player
|
||||
// does nothing
|
||||
TEST_F(DestroyableTest, RequestResurrectOnlyWhenDead) {
|
||||
GameMessages::RequestResurrect request;
|
||||
destroyableComponent->SetIsDead(false);
|
||||
request.Handle(*baseEntity, UNASSIGNED_SYSTEM_ADDRESS);
|
||||
EXPECT_FALSE(destroyableComponent->GetIsResurrecting());
|
||||
|
||||
destroyableComponent->SetIsDead(true);
|
||||
request.Handle(*baseEntity, UNASSIGNED_SYSTEM_ADDRESS);
|
||||
EXPECT_TRUE(destroyableComponent->GetIsResurrecting());
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user