diff options
author | Mattes D <github@xoft.cz> | 2014-09-01 13:41:20 +0200 |
---|---|---|
committer | Mattes D <github@xoft.cz> | 2014-09-01 13:41:20 +0200 |
commit | 74204aed6c4be6ef37194b7f317671a3f03f1247 (patch) | |
tree | 98c7825ebf9853cab02300f53d2fc5b25d3ba4cd /src | |
parent | Merge pull request #1363 from mc-server/FurnaceRecipes (diff) | |
parent | Fixed style. (diff) | |
download | cuberite-74204aed6c4be6ef37194b7f317671a3f03f1247.tar cuberite-74204aed6c4be6ef37194b7f317671a3f03f1247.tar.gz cuberite-74204aed6c4be6ef37194b7f317671a3f03f1247.tar.bz2 cuberite-74204aed6c4be6ef37194b7f317671a3f03f1247.tar.lz cuberite-74204aed6c4be6ef37194b7f317671a3f03f1247.tar.xz cuberite-74204aed6c4be6ef37194b7f317671a3f03f1247.tar.zst cuberite-74204aed6c4be6ef37194b7f317671a3f03f1247.zip |
Diffstat (limited to '')
-rw-r--r-- | src/BlockEntities/CommandBlockEntity.cpp | 9 | ||||
-rw-r--r-- | src/Protocol/MojangAPI.cpp | 3 | ||||
-rw-r--r-- | src/RankManager.cpp | 4 | ||||
-rw-r--r-- | src/SetChunkData.cpp | 2 |
4 files changed, 9 insertions, 9 deletions
diff --git a/src/BlockEntities/CommandBlockEntity.cpp b/src/BlockEntities/CommandBlockEntity.cpp index dd0858378..20702a9ac 100644 --- a/src/BlockEntities/CommandBlockEntity.cpp +++ b/src/BlockEntities/CommandBlockEntity.cpp @@ -188,12 +188,11 @@ void cCommandBlockEntity::SaveToJson(Json::Value & a_Value) void cCommandBlockEntity::Execute() { - if (m_World != NULL) + ASSERT(m_World != NULL); // Execute should not be called before the command block is attached to a world + + if (!m_World->AreCommandBlocksEnabled()) { - if (!m_World->AreCommandBlocksEnabled()) - { - return; - } + return; } class CommandBlockOutCb : diff --git a/src/Protocol/MojangAPI.cpp b/src/Protocol/MojangAPI.cpp index 4e5c41a8a..28da83c31 100644 --- a/src/Protocol/MojangAPI.cpp +++ b/src/Protocol/MojangAPI.cpp @@ -158,7 +158,8 @@ cMojangAPI::cMojangAPI(void) : m_NameToUUIDServer(DEFAULT_NAME_TO_UUID_SERVER), m_NameToUUIDAddress(DEFAULT_NAME_TO_UUID_ADDRESS), m_UUIDToProfileServer(DEFAULT_UUID_TO_PROFILE_SERVER), - m_UUIDToProfileAddress(DEFAULT_UUID_TO_PROFILE_ADDRESS) + m_UUIDToProfileAddress(DEFAULT_UUID_TO_PROFILE_ADDRESS), + m_RankMgr(NULL) { } diff --git a/src/RankManager.cpp b/src/RankManager.cpp index dc6eec9e4..e5896f8f3 100644 --- a/src/RankManager.cpp +++ b/src/RankManager.cpp @@ -477,8 +477,8 @@ AString cRankManager::GetPlayerRankName(const AString & a_PlayerUUID) { SQLite::Statement stmt(m_DB, "SELECT Rank.Name FROM Rank LEFT JOIN PlayerRank ON Rank.RankID = PlayerRank.RankID WHERE PlayerRank.PlayerUUID = ?"); stmt.bind(1, a_PlayerUUID); - stmt.executeStep(); - if (stmt.isDone()) + // executeStep returns false on no data + if (!stmt.executeStep()) { // No data returned from the DB return AString(); diff --git a/src/SetChunkData.cpp b/src/SetChunkData.cpp index 97903074a..bfe59fbcb 100644 --- a/src/SetChunkData.cpp +++ b/src/SetChunkData.cpp @@ -134,8 +134,8 @@ void cSetChunkData::RemoveInvalidBlockEntities(void) ); cBlockEntityList::iterator itr2 = itr; itr2++; - m_BlockEntities.erase(itr); delete *itr; + m_BlockEntities.erase(itr); itr = itr2; } else |