diff options
author | admin@omencraft.com <admin@omencraft.com@0a769ca7-a7f5-676a-18bf-c427514a06d6> | 2011-11-10 19:28:21 +0100 |
---|---|---|
committer | admin@omencraft.com <admin@omencraft.com@0a769ca7-a7f5-676a-18bf-c427514a06d6> | 2011-11-10 19:28:21 +0100 |
commit | 993680a39e5c63ef0b370c7f80fa932ede993870 (patch) | |
tree | 612797de94addb518921babb48c7520758f8a642 /source/cPlayer.cpp | |
parent | Some more changes to redstone. (diff) | |
download | cuberite-993680a39e5c63ef0b370c7f80fa932ede993870.tar cuberite-993680a39e5c63ef0b370c7f80fa932ede993870.tar.gz cuberite-993680a39e5c63ef0b370c7f80fa932ede993870.tar.bz2 cuberite-993680a39e5c63ef0b370c7f80fa932ede993870.tar.lz cuberite-993680a39e5c63ef0b370c7f80fa932ede993870.tar.xz cuberite-993680a39e5c63ef0b370c7f80fa932ede993870.tar.zst cuberite-993680a39e5c63ef0b370c7f80fa932ede993870.zip |
Diffstat (limited to '')
-rw-r--r-- | source/cPlayer.cpp | 16 |
1 files changed, 15 insertions, 1 deletions
diff --git a/source/cPlayer.cpp b/source/cPlayer.cpp index 706886d88..8238f327c 100644 --- a/source/cPlayer.cpp +++ b/source/cPlayer.cpp @@ -28,6 +28,7 @@ #include "packets/cPacket_DestroyEntity.h"
#include "packets/cPacket_Metadata.h"
#include "packets/cPacket_Chat.h"
+#include "packets/cPacket_NewInvalidState.h"
#include "Vector3d.h"
#include "Vector3f.h"
@@ -423,7 +424,20 @@ void cPlayer::SetLastBlockActionCnt( int a_LastBlockActionCnt ) void cPlayer::SetGameMode( int a_GameMode )
{
- m_GameMode = a_GameMode;
+ if ( (a_GameMode < 2) && (a_GameMode >= 0) ) {
+ if (m_GameMode != a_GameMode) {
+ m_GameMode = a_GameMode;
+ cPacket_NewInvalidState GameModePacket;
+ GameModePacket.m_Reason = 3; //GameModeChange
+ GameModePacket.m_GameMode = (char)a_GameMode; //GameModeChange
+ m_ClientHandle->Send ( GameModePacket );
+ }
+ }
+}
+
+void cPlayer::LoginSetGameMode( int a_GameMode )
+{
+ m_GameMode = a_GameMode;
}
void cPlayer::SetIP( std::string a_IP )
|