summaryrefslogtreecommitdiffstats
path: root/src/ClientHandle.cpp
diff options
context:
space:
mode:
authorMattes D <github@xoft.cz>2014-08-02 11:10:02 +0200
committerMattes D <github@xoft.cz>2014-08-02 11:10:02 +0200
commit543b0ccf756129df195011ec60bebac072c91d5a (patch)
tree91b4dfb63a419f88333b2c7bfc0beacd431d2d22 /src/ClientHandle.cpp
parentFixed issues with autocomplete and time loading (diff)
parentFixed a bug who can used from hacked clients. (diff)
downloadcuberite-543b0ccf756129df195011ec60bebac072c91d5a.tar
cuberite-543b0ccf756129df195011ec60bebac072c91d5a.tar.gz
cuberite-543b0ccf756129df195011ec60bebac072c91d5a.tar.bz2
cuberite-543b0ccf756129df195011ec60bebac072c91d5a.tar.lz
cuberite-543b0ccf756129df195011ec60bebac072c91d5a.tar.xz
cuberite-543b0ccf756129df195011ec60bebac072c91d5a.tar.zst
cuberite-543b0ccf756129df195011ec60bebac072c91d5a.zip
Diffstat (limited to '')
-rw-r--r--src/ClientHandle.cpp17
1 files changed, 16 insertions, 1 deletions
diff --git a/src/ClientHandle.cpp b/src/ClientHandle.cpp
index d71c6a9d8..72257028a 100644
--- a/src/ClientHandle.cpp
+++ b/src/ClientHandle.cpp
@@ -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);
}