1
0
Fork 0

Minor improvements to player freeze

This commit is contained in:
LogicParrot 2016-04-05 21:46:51 +03:00
parent a6b0c74f79
commit bb0e885589
2 changed files with 5 additions and 5 deletions

View File

@ -1039,7 +1039,7 @@ void cClientHandle::HandleLeftClick(int a_BlockX, int a_BlockY, int a_BlockZ, eB
} }
cPluginManager * PlgMgr = cRoot::Get()->GetPluginManager(); cPluginManager * PlgMgr = cRoot::Get()->GetPluginManager();
if (PlgMgr->CallHookPlayerLeftClick(*m_Player, a_BlockX, a_BlockY, a_BlockZ, a_BlockFace, static_cast<char>(a_Status))) if (m_Player->IsFrozen() || PlgMgr->CallHookPlayerLeftClick(*m_Player, a_BlockX, a_BlockY, a_BlockZ, a_BlockFace, static_cast<char>(a_Status)))
{ {
// A plugin doesn't agree with the action, replace the block on the client and quit: // A plugin doesn't agree with the action, replace the block on the client and quit:
m_Player->GetWorld()->SendBlockTo(a_BlockX, a_BlockY, a_BlockZ, m_Player); m_Player->GetWorld()->SendBlockTo(a_BlockX, a_BlockY, a_BlockZ, m_Player);
@ -1340,7 +1340,7 @@ void cClientHandle::HandleRightClick(int a_BlockX, int a_BlockY, int a_BlockZ, e
} }
cPluginManager * PlgMgr = cRoot::Get()->GetPluginManager(); cPluginManager * PlgMgr = cRoot::Get()->GetPluginManager();
if (PlgMgr->CallHookPlayerRightClick(*m_Player, a_BlockX, a_BlockY, a_BlockZ, a_BlockFace, a_CursorX, a_CursorY, a_CursorZ)) if (m_Player->IsFrozen() || PlgMgr->CallHookPlayerRightClick(*m_Player, a_BlockX, a_BlockY, a_BlockZ, a_BlockFace, a_CursorX, a_CursorY, a_CursorZ))
{ {
// A plugin doesn't agree with the action, replace the block on the client and quit: // A plugin doesn't agree with the action, replace the block on the client and quit:
if (AreRealCoords) if (AreRealCoords)
@ -1441,7 +1441,7 @@ void cClientHandle::HandleRightClick(int a_BlockX, int a_BlockY, int a_BlockZ, e
return; return;
} }
m_Player->StartEating(); m_Player->StartEating();
if (PlgMgr->CallHookPlayerEating(*m_Player)) if (m_Player->IsFrozen() || PlgMgr->CallHookPlayerEating(*m_Player))
{ {
// A plugin won't let us eat, abort (send the proper packets to the client, too): // A plugin won't let us eat, abort (send the proper packets to the client, too):
m_Player->AbortEating(); m_Player->AbortEating();
@ -1449,7 +1449,7 @@ void cClientHandle::HandleRightClick(int a_BlockX, int a_BlockY, int a_BlockZ, e
} }
else else
{ {
if (PlgMgr->CallHookPlayerUsingItem(*m_Player, a_BlockX, a_BlockY, a_BlockZ, a_BlockFace, a_CursorX, a_CursorY, a_CursorZ)) if (m_Player->IsFrozen() || PlgMgr->CallHookPlayerUsingItem(*m_Player, a_BlockX, a_BlockY, a_BlockZ, a_BlockFace, a_CursorX, a_CursorY, a_CursorZ))
{ {
// A plugin doesn't agree with using the item, abort // A plugin doesn't agree with using the item, abort
return; return;

View File

@ -354,7 +354,7 @@ void cPlayer::TickFreezeCode()
} }
} }
} }
else if (GetWorld()->GetWorldAge() % 4096 == 0) else if (GetWorld()->GetWorldAge() % 100 == 0)
{ {
// Despite the client side freeze, the player may be able to move a little by // Despite the client side freeze, the player may be able to move a little by
// Jumping or canceling flight. Re-freeze every now and then // Jumping or canceling flight. Re-freeze every now and then