1
0

Creative mode hits immediately disappear boats (#5117)

Instant destroy boat in creative mode

+ boat one-shot in creative mode
+ Add boat instant destroy in creative
+ Instant break boat in creative
This commit is contained in:
Simerson 2021-01-28 23:39:40 +01:00 committed by GitHub
parent 50a94f972d
commit b1b7424c43
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -75,6 +75,16 @@ bool cBoat::DoTakeDamage(TakeDamageInfo & TDI)
m_World->BroadcastEntityMetadata(*this);
if ((TDI.Attacker != nullptr) && (TDI.Attacker->IsPlayer()))
{
cPlayer * Destroyer = static_cast<cPlayer *>(TDI.Attacker);
if (Destroyer->IsGameModeCreative())
{
Destroy();
return true;
}
}
if (GetHealth() <= 0)
{
if (TDI.Attacker != nullptr)