Fixed a bug who can used from hacked clients.
This commit is contained in:
parent
b5c0a4aa3a
commit
3b4255dbfe
@ -90,6 +90,7 @@ bool cBeaconEntity::SetPrimaryEffect(cEntityEffect::eType a_Effect)
|
||||
{
|
||||
if (!IsValidEffect(a_Effect, m_BeaconLevel))
|
||||
{
|
||||
m_PrimaryEffect = cEntityEffect::effNoEffect;
|
||||
return false;
|
||||
}
|
||||
|
||||
@ -111,6 +112,7 @@ bool cBeaconEntity::SetSecondaryEffect(cEntityEffect::eType a_Effect)
|
||||
{
|
||||
if (!IsValidEffect(a_Effect, m_BeaconLevel))
|
||||
{
|
||||
m_SecondaryEffect = cEntityEffect::effNoEffect;
|
||||
return false;
|
||||
}
|
||||
|
||||
|
@ -795,7 +795,22 @@ void cClientHandle::HandleBeaconSelection(const char * a_Data, size_t a_Length)
|
||||
|
||||
Window->SetSlot(*m_Player, 0, cItem());
|
||||
BeaconWindow->GetBeaconEntity()->SetPrimaryEffect(PrimaryEffect);
|
||||
BeaconWindow->GetBeaconEntity()->SetSecondaryEffect(SecondaryEffect);
|
||||
|
||||
// Valid effect check. Vanilla don't check this, but we do it :)
|
||||
if (
|
||||
(SecondaryEffect == cEntityEffect::effNoEffect) ||
|
||||
(SecondaryEffect == cEntityEffect::effRegeneration) ||
|
||||
(SecondaryEffect == BeaconWindow->GetBeaconEntity()->GetPrimaryEffect())
|
||||
)
|
||||
{
|
||||
BeaconWindow->GetBeaconEntity()->SetSecondaryEffect(SecondaryEffect);
|
||||
}
|
||||
else
|
||||
{
|
||||
BeaconWindow->GetBeaconEntity()->SetSecondaryEffect(cEntityEffect::effNoEffect);
|
||||
}
|
||||
|
||||
m_Player->CloseWindow(true);
|
||||
}
|
||||
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user