1
0
Fork 0

Don't allow players in adventure mode to break blocks (#5293)

This commit is contained in:
Ethan Jones 2021-09-15 11:33:45 -06:00 committed by GitHub
parent af93c297f4
commit 9712c5507c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 6 additions and 0 deletions

View File

@ -1143,6 +1143,12 @@ void cClientHandle::HandleLeftClick(int a_BlockX, int a_BlockY, int a_BlockZ, eB
void cClientHandle::HandleBlockDigStarted(int a_BlockX, int a_BlockY, int a_BlockZ, eBlockFace a_BlockFace)
{
if (m_Player->IsGameModeAdventure())
{
// Players in adventure mode can't destroy blocks
return;
}
if (
m_HasStartedDigging &&
(a_BlockX == m_LastDigBlockX) &&