From e5e970baec14513d275a0da8c5db930a59524c4b Mon Sep 17 00:00:00 2001 From: zwerg Date: Sat, 9 Feb 2013 23:17:29 +0100 Subject: [PATCH 01/16] Core/Spells: Fix cooldown problems for Val'anyr, Hammer of Ancient Kings Closes #9162 --- src/server/scripts/Spells/spell_item.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/server/scripts/Spells/spell_item.cpp b/src/server/scripts/Spells/spell_item.cpp index b8e17f4ecc..d57ed6e126 100644 --- a/src/server/scripts/Spells/spell_item.cpp +++ b/src/server/scripts/Spells/spell_item.cpp @@ -140,7 +140,7 @@ class spell_item_blessing_of_ancient_kings : public SpellScriptLoader protEff->SetAmount(std::min(protEff->GetAmount() + absorb, 20000)); // Refresh and return to prevent replacing the aura - aurEff->GetBase()->RefreshDuration(); + protEff->GetBase()->RefreshDuration(); } else GetTarget()->CastCustomSpell(SPELL_PROTECTION_OF_ANCIENT_KINGS, SPELLVALUE_BASE_POINT0, absorb, eventInfo.GetProcTarget(), true, NULL, aurEff); From 38eb090e9a6f6cf5752d54dcfceaa5bc5d32cdae Mon Sep 17 00:00:00 2001 From: Shauren Date: Sat, 9 Feb 2013 23:59:09 +0100 Subject: [PATCH 02/16] Core/Objects: Rewritten UpdateMask class to perform bit operations faster at the cost of higher memory use and moved building the mask for packet to a separate method. Closes #9127 --- src/server/game/Entities/Object/Object.cpp | 2 +- .../game/Entities/Object/Updates/UpdateMask.h | 132 +++++++++--------- 2 files changed, 67 insertions(+), 67 deletions(-) diff --git a/src/server/game/Entities/Object/Object.cpp b/src/server/game/Entities/Object/Object.cpp index 8f89e58ad5..893d4c1ea6 100644 --- a/src/server/game/Entities/Object/Object.cpp +++ b/src/server/game/Entities/Object/Object.cpp @@ -509,7 +509,7 @@ void Object::_BuildValuesUpdate(uint8 updatetype, ByteBuffer * data, UpdateMask* WPAssert(updateMask && updateMask->GetCount() == m_valuesCount); *data << (uint8)updateMask->GetBlockCount(); - data->append(updateMask->GetMask(), updateMask->GetLength()); + updateMask->AppendToPacket(data); // 2 specialized loops for speed optimization in non-unit case if (isType(TYPEMASK_UNIT)) // unit (creature/player) case diff --git a/src/server/game/Entities/Object/Updates/UpdateMask.h b/src/server/game/Entities/Object/Updates/UpdateMask.h index 784c4eba96..8be8dfecda 100644 --- a/src/server/game/Entities/Object/Updates/UpdateMask.h +++ b/src/server/game/Entities/Object/Updates/UpdateMask.h @@ -21,106 +21,106 @@ #include "UpdateFields.h" #include "Errors.h" +#include "ByteBuffer.h" class UpdateMask { public: - UpdateMask() : mCount(0), mBlocks(0), mUpdateMask(0) { } - UpdateMask(UpdateMask const& mask) : mUpdateMask(0) { *this = mask; } + /// Type representing how client reads update mask + typedef uint32 ClientUpdateMaskType; - ~UpdateMask() + enum UpdateMaskCount { - delete[] mUpdateMask; + CLIENT_UPDATE_MASK_BITS = sizeof(ClientUpdateMaskType) * 8, + }; + + UpdateMask() : _fieldCount(0), _blockCount(0), _bits(NULL) { } + + UpdateMask(UpdateMask const& right) + { + SetCount(right.GetCount()); + memcpy(_bits, right._bits, sizeof(uint8) * _blockCount * 32); } - void SetBit(uint32 index) + ~UpdateMask() { delete[] _bits; } + + void SetBit(uint32 index) { _bits[index] = 1; } + void UnsetBit(uint32 index) { _bits[index] = 0; } + bool GetBit(uint32 index) const { return _bits[index] != 0; } + + void AppendToPacket(ByteBuffer* data) { - ((uint8*)mUpdateMask)[index >> 3] |= 1 << (index & 0x7); + for (uint32 i = 0; i < GetBlockCount(); ++i) + { + ClientUpdateMaskType maskPart = 0; + for (uint32 j = 0; j < CLIENT_UPDATE_MASK_BITS; ++j) + if (_bits[CLIENT_UPDATE_MASK_BITS * i + j]) + maskPart |= 1 << j; + + *data << maskPart; + } } - void UnsetBit(uint32 index) + uint32 GetBlockCount() const { return _blockCount; } + uint32 GetCount() const { return _fieldCount; } + + void SetCount(uint32 valuesCount) { - ((uint8*)mUpdateMask)[index >> 3] &= (0xff ^ (1 << (index & 0x7))); - } + delete[] _bits; - bool GetBit(uint32 index) const - { - return (((uint8*)mUpdateMask)[index >> 3] & (1 << (index & 0x7))) != 0; - } + _fieldCount = valuesCount; + _blockCount = (valuesCount + CLIENT_UPDATE_MASK_BITS - 1) / CLIENT_UPDATE_MASK_BITS; - uint32 GetBlockCount() const { return mBlocks; } - uint32 GetLength() const { return mBlocks << 2; } - uint32 GetCount() const { return mCount; } - uint8* GetMask() { return (uint8*)mUpdateMask; } - - void SetCount (uint32 valuesCount) - { - delete [] mUpdateMask; - - mCount = valuesCount; - mBlocks = (valuesCount + 31) / 32; - - mUpdateMask = new uint32[mBlocks]; - memset(mUpdateMask, 0, mBlocks << 2); + _bits = new uint8[_blockCount * CLIENT_UPDATE_MASK_BITS]; + memset(_bits, 0, sizeof(uint8) * _blockCount * CLIENT_UPDATE_MASK_BITS); } void Clear() { - if (mUpdateMask) - memset(mUpdateMask, 0, mBlocks << 2); + if (_bits) + memset(_bits, 0, sizeof(uint8) * _blockCount * CLIENT_UPDATE_MASK_BITS); } - UpdateMask& operator=(UpdateMask const& mask) + UpdateMask& operator=(UpdateMask const& right) { - if (this == &mask) + if (this == &right) return *this; - SetCount(mask.mCount); - memcpy(mUpdateMask, mask.mUpdateMask, mBlocks << 2); + SetCount(right.GetCount()); + memcpy(_bits, right._bits, sizeof(uint8) * _blockCount * CLIENT_UPDATE_MASK_BITS); + return *this; + } + + UpdateMask& operator&=(UpdateMask const& right) + { + ASSERT(right.GetCount() <= GetCount()); + for (uint32 i = 0; i < _fieldCount; ++i) + _bits[i] &= right._bits[i]; return *this; } - void operator&=(UpdateMask const& mask) + UpdateMask& operator|=(UpdateMask const& right) { - ASSERT(mask.mCount <= mCount); - for (uint32 i = 0; i < mBlocks; ++i) - mUpdateMask[i] &= mask.mUpdateMask[i]; + ASSERT(right.GetCount() <= GetCount()); + for (uint32 i = 0; i < _fieldCount; ++i) + _bits[i] |= right._bits[i]; + + return *this; } - void operator|=(UpdateMask const& mask) + UpdateMask operator|(UpdateMask const& right) { - ASSERT(mask.mCount <= mCount); - for (uint32 i = 0; i < mBlocks; ++i) - mUpdateMask[i] |= mask.mUpdateMask[i]; - } - - UpdateMask operator&(UpdateMask const& mask) const - { - ASSERT(mask.mCount <= mCount); - - UpdateMask newmask; - newmask = *this; - newmask &= mask; - - return newmask; - } - - UpdateMask operator|(UpdateMask const& mask) const - { - ASSERT(mask.mCount <= mCount); - - UpdateMask newmask; - newmask = *this; - newmask |= mask; - - return newmask; + UpdateMask ret(*this); + ret |= right; + return ret; } private: - uint32 mCount; - uint32 mBlocks; - uint32 *mUpdateMask; + uint32 _fieldCount; + uint32 _blockCount; + uint8* _bits; }; + #endif From caf70ee40db1854e957dd4f2806cdeebc552512d Mon Sep 17 00:00:00 2001 From: Vincent_Michael Date: Sat, 9 Feb 2013 23:59:32 +0100 Subject: [PATCH 03/16] DB/Creature: Fix Onyxian Lair Guard equipment --- .../world/2013_02_09_01_world_creature_equip_template.sql | 5 +++++ 1 file changed, 5 insertions(+) create mode 100644 sql/updates/world/2013_02_09_01_world_creature_equip_template.sql diff --git a/sql/updates/world/2013_02_09_01_world_creature_equip_template.sql b/sql/updates/world/2013_02_09_01_world_creature_equip_template.sql new file mode 100644 index 0000000000..fd207746ac --- /dev/null +++ b/sql/updates/world/2013_02_09_01_world_creature_equip_template.sql @@ -0,0 +1,5 @@ +UPDATE `creature_template` SET `equipment_id`=36561 WHERE `entry` IN (36561,36571); + +DELETE FROM `creature_equip_template` WHERE `entry`=36561; +INSERT INTO `creature_equip_template` (`entry`, `itemEntry1`, `itemEntry2`, `itemEntry3`) VALUES +(36561, 38488, 0, 0); -- Onyxian Lair Guard From 8e58779d91ab03d647d3133b785b5ecf1069e897 Mon Sep 17 00:00:00 2001 From: Kinzcool Date: Sat, 9 Feb 2013 19:36:29 -0500 Subject: [PATCH 04/16] DB/Triggers: Fixed access to Duskwither Spire --- .../world/2013_02_09_02_world_areatrigger_teleport.sql | 4 ++++ 1 file changed, 4 insertions(+) create mode 100644 sql/updates/world/2013_02_09_02_world_areatrigger_teleport.sql diff --git a/sql/updates/world/2013_02_09_02_world_areatrigger_teleport.sql b/sql/updates/world/2013_02_09_02_world_areatrigger_teleport.sql new file mode 100644 index 0000000000..2a0c1682e3 --- /dev/null +++ b/sql/updates/world/2013_02_09_02_world_areatrigger_teleport.sql @@ -0,0 +1,4 @@ +DELETE FROM `areatrigger_teleport` WHERE `id` IN (4233, 4267); +INSERT INTO `areatrigger_teleport` (`id`, `target_map`, `target_position_x`, `target_position_y`, `target_position_z`, `target_orientation`, `name`) VALUES +(4233, 530, 9331.49, -7812.27, 136.569, 5.23599, 'Eversong Woods - Duskwither UP Target'), +(4267, 530, 9334.03, -7880.02, 74.9095, 2.35619, 'Eversong Woods - Duskwither DOWN Target'); From 92573c4fb55bb80b7262afa59c35363a0794e936 Mon Sep 17 00:00:00 2001 From: Vincent_Michael Date: Sun, 10 Feb 2013 04:53:48 +0100 Subject: [PATCH 05/16] DB/Factionchange: Add a missing spell (Teleport: Darnassus / Teleport: Thunder Bluff) at player_factionchange_spells --- .../world/2013_02_09_03_world_player_factionchange_spells.sql | 3 +++ 1 file changed, 3 insertions(+) create mode 100644 sql/updates/world/2013_02_09_03_world_player_factionchange_spells.sql diff --git a/sql/updates/world/2013_02_09_03_world_player_factionchange_spells.sql b/sql/updates/world/2013_02_09_03_world_player_factionchange_spells.sql new file mode 100644 index 0000000000..22f69b11aa --- /dev/null +++ b/sql/updates/world/2013_02_09_03_world_player_factionchange_spells.sql @@ -0,0 +1,3 @@ +DELETE FROM `player_factionchange_spells` WHERE `alliance_id`=3565 AND `horde_id`=3566; +INSERT INTO `player_factionchange_spells` (`alliance_id`, `horde_id`) VALUES +(3565, 3566); -- Teleport: Darnassus / Teleport: Thunder Bluff From 1b4a6109764d74d6b440bcd796c2b375aa660096 Mon Sep 17 00:00:00 2001 From: Kinzcool Date: Sun, 10 Feb 2013 13:05:53 -0500 Subject: [PATCH 06/16] DB/Triggers: Added anti-exploration in Hellfire Ramparts --- sql/updates/world/2013_02_10_00_world_areatrigger_teleport.sql | 3 +++ 1 file changed, 3 insertions(+) create mode 100644 sql/updates/world/2013_02_10_00_world_areatrigger_teleport.sql diff --git a/sql/updates/world/2013_02_10_00_world_areatrigger_teleport.sql b/sql/updates/world/2013_02_10_00_world_areatrigger_teleport.sql new file mode 100644 index 0000000000..b5f5c856fe --- /dev/null +++ b/sql/updates/world/2013_02_10_00_world_areatrigger_teleport.sql @@ -0,0 +1,3 @@ +DELETE FROM `areatrigger_teleport` WHERE `id`=4304; +INSERT INTO `areatrigger_teleport` (`id`, `target_map`, `target_position_x`, `target_position_y`, `target_position_z`, `target_orientation`, `name`) VALUES +(4304, 530, -233.33, 3199.71, -50, 0.785398, 'Hellfire Ramparts - Omor Exit Target'); From 2cf8cdaa800b032eba484811f65cf619af07e80f Mon Sep 17 00:00:00 2001 From: click Date: Mon, 11 Feb 2013 01:56:25 +0100 Subject: [PATCH 07/16] Buildsystem/CMake: Drop a FATAL_ERROR-message if the git binary is not found or outdated. Allow for it to be pointed to through the ADVANCED settings in the CMake GUI if the above is true. --- cmake/genrev.cmake | 30 ++++++++++++++++++++---------- 1 file changed, 20 insertions(+), 10 deletions(-) diff --git a/cmake/genrev.cmake b/cmake/genrev.cmake index c7a188d199..0df1770e14 100644 --- a/cmake/genrev.cmake +++ b/cmake/genrev.cmake @@ -12,17 +12,23 @@ include(${CMAKE_SOURCE_DIR}/cmake/macros/EnsureVersion.cmake) set(_REQUIRED_GIT_VERSION "1.7") -find_program(_GIT_EXEC +find_program(GIT_EXEC NAMES git git.cmd HINTS ENV PATH - DOC "git installation path" + DOC "Full path to git commandline client" ) +MARK_AS_ADVANCED(GIT_EXEC) -if(_GIT_EXEC) +if(NOT GIT_EXEC) + message(FATAL_ERROR " + Git was NOT FOUND on your system - did you forget to install a recent version, or setting the path to it? + Observe that for revision hash/date to work you need at least version ${_REQUIRED_GIT_VERSION} + ") +else() execute_process( - COMMAND "${_GIT_EXEC}" --version + COMMAND "${GIT_EXEC}" --version WORKING_DIRECTORY "${CMAKE_SOURCE_DIR}" OUTPUT_VARIABLE _GIT_VERSION ERROR_QUIET @@ -30,27 +36,31 @@ if(_GIT_EXEC) # make sure we're using minimum the required version of git, so the "dirty-testing" will work properly ensure_version( "${_REQUIRED_GIT_VERSION}" "${_GIT_VERSION}" _GIT_VERSION_OK) + + # throw an error if we don't have a recent enough version of git... + if(NOT _GIT_VERSION_OK) + message(FATAL_ERROR " + Git was found but is OUTDATED - did you forget to install a recent version, or setting the path to it? + Observe that for revision hash/date to work you need at least version ${_REQUIRED_GIT_VERSION} + ") + endif() endif() if(_GIT_VERSION_OK) execute_process( - COMMAND "${_GIT_EXEC}" describe --match init --dirty=+ --abbrev=12 + COMMAND "${GIT_EXEC}" describe --match init --dirty=+ --abbrev=12 WORKING_DIRECTORY "${CMAKE_SOURCE_DIR}" OUTPUT_VARIABLE rev_info OUTPUT_STRIP_TRAILING_WHITESPACE ERROR_QUIET ) execute_process( - COMMAND "${_GIT_EXEC}" show -s --format=%ci + COMMAND "${GIT_EXEC}" show -s --format=%ci WORKING_DIRECTORY "${CMAKE_SOURCE_DIR}" OUTPUT_VARIABLE rev_date OUTPUT_STRIP_TRAILING_WHITESPACE ERROR_QUIET ) -else() - message("") - message(STATUS "WARNING - Missing or outdated git - did you forget to install a recent version?") - message(STATUS "WARNING - Observe that for revision hash/date to work you need at least version ${_REQUIRED_GIT_VERSION}") endif() # Last minute check - ensure that we have a proper revision From 42e660e2a2f6642141a138760bbfefd78a6fb501 Mon Sep 17 00:00:00 2001 From: Nay Date: Mon, 11 Feb 2013 02:59:07 +0000 Subject: [PATCH 08/16] Core/Sockets: Always try to send MSG_NOSIGNAL in peer().send() Fixes RASocket::authenticate crash "MSG_NOSIGNAL: If you send() to a remote host which is no longer recv()ing, you'll typically get the signal SIGPIPE. Adding this flag prevents that signal from being raised." Closes #5040 Thanks to @derex for the hint --- src/server/authserver/Server/RealmSocket.cpp | 4 ++++ src/server/game/Server/WorldSocket.cpp | 4 ++-- src/server/worldserver/RemoteAccess/RASocket.cpp | 5 +++++ 3 files changed, 11 insertions(+), 2 deletions(-) diff --git a/src/server/authserver/Server/RealmSocket.cpp b/src/server/authserver/Server/RealmSocket.cpp index e67af783d5..2e64321d8a 100644 --- a/src/server/authserver/Server/RealmSocket.cpp +++ b/src/server/authserver/Server/RealmSocket.cpp @@ -138,7 +138,11 @@ ssize_t RealmSocket::noblk_send(ACE_Message_Block &message_block) return -1; // Try to send the message directly. +#ifdef MSG_NOSIGNAL ssize_t n = peer().send(message_block.rd_ptr(), len, MSG_NOSIGNAL); +#else + ssize_t n = peer().send(message_block.rd_ptr(), len); +#endif // MSG_NOSIGNAL if (n < 0) { diff --git a/src/server/game/Server/WorldSocket.cpp b/src/server/game/Server/WorldSocket.cpp index b2534bfbb0..de5dd1dd98 100644 --- a/src/server/game/Server/WorldSocket.cpp +++ b/src/server/game/Server/WorldSocket.cpp @@ -372,9 +372,9 @@ int WorldSocket::handle_output_queue (GuardType& g) const size_t send_len = mblk->length(); #ifdef MSG_NOSIGNAL - ssize_t n = peer().send (mblk->rd_ptr(), send_len, MSG_NOSIGNAL); + ssize_t n = peer().send(mblk->rd_ptr(), send_len, MSG_NOSIGNAL); #else - ssize_t n = peer().send (mblk->rd_ptr(), send_len); + ssize_t n = peer().send(mblk->rd_ptr(), send_len); #endif // MSG_NOSIGNAL if (n == 0) diff --git a/src/server/worldserver/RemoteAccess/RASocket.cpp b/src/server/worldserver/RemoteAccess/RASocket.cpp index b939f26723..ee05e83ad4 100644 --- a/src/server/worldserver/RemoteAccess/RASocket.cpp +++ b/src/server/worldserver/RemoteAccess/RASocket.cpp @@ -336,7 +336,12 @@ int RASocket::subnegotiate() //! Just send back end of subnegotiation packet uint8 const reply[2] = {0xFF, 0xF0}; + +#ifdef MSG_NOSIGNAL + return int(peer().send(reply, 2, MSG_NOSIGNAL)); +#else return int(peer().send(reply, 2)); +#endif // MSG_NOSIGNAL } int RASocket::svc(void) From 12359b993d5bff183e59e1355f5d291ac0ca45a6 Mon Sep 17 00:00:00 2001 From: Nay Date: Mon, 11 Feb 2013 03:10:02 +0000 Subject: [PATCH 09/16] DB/NPCs: Set trigger flags_extra to a bunch of quest credit markers God damn Aokromes, always making me do work and stuff... --- .../2013_02_11_00_world_creature_template.sql | 26 +++++++++++++++++++ 1 file changed, 26 insertions(+) create mode 100644 sql/updates/world/2013_02_11_00_world_creature_template.sql diff --git a/sql/updates/world/2013_02_11_00_world_creature_template.sql b/sql/updates/world/2013_02_11_00_world_creature_template.sql new file mode 100644 index 0000000000..dbbc726778 --- /dev/null +++ b/sql/updates/world/2013_02_11_00_world_creature_template.sql @@ -0,0 +1,26 @@ +UPDATE `creature_template` SET `flags_extra`=`flags_extra`|128 WHERE `entry` IN ( + 17413, -- Sedai Quest Credit Marker + 21121, -- Bonechewer Quest credit marker + 24887, -- Fengir Quest Credit + 24888, -- Isuldof Quest Credit + 24889, -- Rodin Quest Credit + 24890, -- Windan Quest Credit + 27471, -- Forgotten Rifleman Quest Credit + 27472, -- Forgotten Peasant Quest Credit + 27473, -- Forgotten Knight Quest Credit + 27474, -- Captain Luc D'Merud Quest Credit + 27879, -- Frostmourne Cavern Quest Credit + 38503, -- Blood Infusion Quest Credit Bunny + 38546, -- Frost Infusion Quest Credit + 38547, -- Sindragosa Quest Credit + 39355, -- [DND] Salute Quest Credit Bunny + 39356, -- [DND] Roar Quest Credit Bunny + 39361, -- [DND] Dance Quest Credit Bunny + 39362, -- [DND] Cheer Quest Credit Bunny + 39683, -- [DND] Quest Credit Bunny - Eject + 39691, -- [DND] Quest Credit Bunny - Move 1 + 39692, -- [DND] Quest Credit Bunny - Move 2 + 39695, -- [DND] Quest Credit Bunny - Move 3 + 39703, -- [DND] Quest Credit Bunny - Attack + 40428 -- [DND] Quest Credit Bunny - ET Battle +); From db0b81e8e78a3c5b42e5b45efdda2c2c99f1e312 Mon Sep 17 00:00:00 2001 From: Nay Date: Mon, 11 Feb 2013 03:33:02 +0000 Subject: [PATCH 10/16] Core/RealmSocket: Remove a not required #ifndef MSG_NOSIGNAL / #define MSG_NOSIGNAL 0 Somewhere in ACE overloads of send(), flags are default'ed to 0 if not provided --- src/server/authserver/Server/RealmSocket.cpp | 4 ---- 1 file changed, 4 deletions(-) diff --git a/src/server/authserver/Server/RealmSocket.cpp b/src/server/authserver/Server/RealmSocket.cpp index 2e64321d8a..565a8c9a60 100644 --- a/src/server/authserver/Server/RealmSocket.cpp +++ b/src/server/authserver/Server/RealmSocket.cpp @@ -23,10 +23,6 @@ #include "RealmSocket.h" #include "Log.h" -#ifndef MSG_NOSIGNAL -#define MSG_NOSIGNAL 0 -#endif - RealmSocket::Session::Session(void) {} RealmSocket::Session::~Session(void) { } From 620a43b4efa429a34f1671d1ede39f43dffeee9d Mon Sep 17 00:00:00 2001 From: click Date: Mon, 11 Feb 2013 14:51:26 +0100 Subject: [PATCH 11/16] Buildsystem/CMake: Allow building the core without the gitchecks, this is done in the GUI, or through the DISABLEGITCHECK parameter on *nix-platforms. DO NOTE THAT WE WILL NOT GIVE SUPPORT ON ANY CORE-VERSION COMPILED WITH THIS FLAG, AS WE CAN NOT EFFECTIVELY FIND OUT WHAT REVISION YOU ARE ON --- cmake/genrev.cmake | 131 ++++++++++++++++++++++++-------------------- cmake/options.cmake | 1 + 2 files changed, 74 insertions(+), 58 deletions(-) diff --git a/cmake/genrev.cmake b/cmake/genrev.cmake index 0df1770e14..86acc6df22 100644 --- a/cmake/genrev.cmake +++ b/cmake/genrev.cmake @@ -10,70 +10,85 @@ include(${CMAKE_SOURCE_DIR}/cmake/macros/EnsureVersion.cmake) -set(_REQUIRED_GIT_VERSION "1.7") +# User has manually chosen to ignore the git-tests, so we create an arbitrary string for the revisionhash/date as well +if(DISABLEGITCHECK) + message(STATUS " + By choosing the DISABLEGITCHECK option, you waive all rights for support, and accept + that any or all requests for assistance by you to core developers will be rejected. -find_program(GIT_EXEC - NAMES - git git.cmd - HINTS - ENV PATH - DOC "Full path to git commandline client" -) -MARK_AS_ADVANCED(GIT_EXEC) + You, as user, take full responsibility for issues, problems etc that might arise + from using the core, as we we can not properly detect what codebase you're using. -if(NOT GIT_EXEC) - message(FATAL_ERROR " - Git was NOT FOUND on your system - did you forget to install a recent version, or setting the path to it? - Observe that for revision hash/date to work you need at least version ${_REQUIRED_GIT_VERSION} + We remind you that you need to use the repository and a proper version of git for + the revision/hash to work, and thus get our support if the need arises. ") -else() - execute_process( - COMMAND "${GIT_EXEC}" --version - WORKING_DIRECTORY "${CMAKE_SOURCE_DIR}" - OUTPUT_VARIABLE _GIT_VERSION - ERROR_QUIET - ) - # make sure we're using minimum the required version of git, so the "dirty-testing" will work properly - ensure_version( "${_REQUIRED_GIT_VERSION}" "${_GIT_VERSION}" _GIT_VERSION_OK) - - # throw an error if we don't have a recent enough version of git... - if(NOT _GIT_VERSION_OK) - message(FATAL_ERROR " - Git was found but is OUTDATED - did you forget to install a recent version, or setting the path to it? - Observe that for revision hash/date to work you need at least version ${_REQUIRED_GIT_VERSION} - ") - endif() -endif() - -if(_GIT_VERSION_OK) - execute_process( - COMMAND "${GIT_EXEC}" describe --match init --dirty=+ --abbrev=12 - WORKING_DIRECTORY "${CMAKE_SOURCE_DIR}" - OUTPUT_VARIABLE rev_info - OUTPUT_STRIP_TRAILING_WHITESPACE - ERROR_QUIET - ) - execute_process( - COMMAND "${GIT_EXEC}" show -s --format=%ci - WORKING_DIRECTORY "${CMAKE_SOURCE_DIR}" - OUTPUT_VARIABLE rev_date - OUTPUT_STRIP_TRAILING_WHITESPACE - ERROR_QUIET - ) -endif() - -# Last minute check - ensure that we have a proper revision -# If everything above fails (means the user has erased the git revision control directory or removed the origin/HEAD tag) -if(NOT rev_info) - # No valid ways available to find/set the revision/hash, so let's force some defaults - message(STATUS "WARNING - Missing repository tags - you may need to pull tags with git fetch -t") - message(STATUS "WARNING - Continuing anyway - note that the versionstring will be set to 0000-00-00 00:00:00 (Archived)") + # Set an arbitrary date and hash, so we can match on that set(rev_date "0000-00-00 00:00:00 +0000") - set(rev_hash "Archived") + set(rev_hash "TC-COPY-WITH-NO-GIT-SUPPORT") else() - # Extract information required to build a proper versionstring - string(REGEX REPLACE init-|[0-9]+-g "" rev_hash ${rev_info}) + set(_REQUIRED_GIT_VERSION "1.7") + find_program(GIT_EXEC + NAMES + git git.cmd + HINTS + ENV PATH + DOC "Full path to git commandline client" + ) + MARK_AS_ADVANCED(GIT_EXEC) + + if(NOT GIT_EXEC) + message(FATAL_ERROR " + Git was NOT FOUND on your system - did you forget to install a recent version, or setting the path to it? + Observe that for revision hash/date to work you need at least version ${_REQUIRED_GIT_VERSION}") + else() + execute_process( + COMMAND "${GIT_EXEC}" --version + WORKING_DIRECTORY "${CMAKE_SOURCE_DIR}" + OUTPUT_VARIABLE _GIT_VERSION + ERROR_QUIET + ) + + # make sure we're using minimum the required version of git, so the "dirty-testing" will work properly + ensure_version( "${_REQUIRED_GIT_VERSION}" "${_GIT_VERSION}" _GIT_VERSION_OK) + + # throw an error if we don't have a recent enough version of git... + if(NOT _GIT_VERSION_OK) + message(FATAL_ERROR " + Git was found but is OUTDATED - did you forget to install a recent version, or setting the path to it? + Observe that for revision hash/date to work you need at least version ${_REQUIRED_GIT_VERSION}") + endif() + endif() + + if(_GIT_VERSION_OK) + execute_process( + COMMAND "${GIT_EXEC}" describe --match init --dirty=+ --abbrev=12 + WORKING_DIRECTORY "${CMAKE_SOURCE_DIR}" + OUTPUT_VARIABLE rev_info + OUTPUT_STRIP_TRAILING_WHITESPACE + ERROR_QUIET + ) + execute_process( + COMMAND "${GIT_EXEC}" show -s --format=%ci + WORKING_DIRECTORY "${CMAKE_SOURCE_DIR}" + OUTPUT_VARIABLE rev_date + OUTPUT_STRIP_TRAILING_WHITESPACE + ERROR_QUIET + ) + endif() + + # Last minute check - ensure that we have a proper revision + # If everything above fails (means the user has erased the git revision control directory or removed the origin/HEAD tag) + if(NOT rev_info) + # No valid ways available to find/set the revision/hash, so let's force some defaults + message(STATUS "WARNING - Missing repository tags - you may need to pull tags with git fetch -t") + message(STATUS "WARNING - Continuing anyway - note that the versionstring will be set to 0000-00-00 00:00:00 (Archived)") + set(rev_date "0000-00-00 00:00:00 +0000") + set(rev_hash "Archived") + else() + # Extract information required to build a proper versionstring + string(REGEX REPLACE init-|[0-9]+-g "" rev_hash ${rev_info}) + endif() endif() # Its not set during initial run diff --git a/cmake/options.cmake b/cmake/options.cmake index f58c88ba1d..60b828abd7 100644 --- a/cmake/options.cmake +++ b/cmake/options.cmake @@ -15,3 +15,4 @@ option(USE_SCRIPTPCH "Use precompiled headers when compiling scripts" option(USE_COREPCH "Use precompiled headers when compiling servers" 1) option(WITH_WARNINGS "Show all warnings during compile" 0) option(WITH_COREDEBUG "Include additional debug-code in core" 0) +option(DISABLEGITCHECK "Disable the GIT testing routines" 0) From 9bd8baf1ab80e7a2f8431fb9d8f02bfc88e25ad2 Mon Sep 17 00:00:00 2001 From: click Date: Mon, 11 Feb 2013 20:04:27 +0100 Subject: [PATCH 12/16] Buildsystem/CMake: Fix an issue with MSVC not finding git-binary when updating the revisionhash/revisiondate + rename DISABLEGITCHECK parameter to WITHOUT_GIT (to adhere to our standard) Also cleaned up the checks slightly + moved git-specific testing to its own macro (minor changes to shaurens original patch applied) --- CMakeLists.txt | 4 ++ cmake/genrev.cmake | 89 ++++++++++++-------------------------- cmake/macros/FindGit.cmake | 46 ++++++++++++++++++++ cmake/options.cmake | 2 +- src/genrev/CMakeLists.txt | 2 +- 5 files changed, 80 insertions(+), 63 deletions(-) create mode 100644 cmake/macros/FindGit.cmake diff --git a/CMakeLists.txt b/CMakeLists.txt index 7b075b6ede..9ea5b4825a 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -61,6 +61,10 @@ if( UNIX ) find_package(BZip2) endif() +if( NOT DISABLEGITCHECK ) + find_package(Git) +endif() + # Find revision ID and hash of the sourcetree include(cmake/genrev.cmake) diff --git a/cmake/genrev.cmake b/cmake/genrev.cmake index 86acc6df22..a335ed2bd5 100644 --- a/cmake/genrev.cmake +++ b/cmake/genrev.cmake @@ -8,92 +8,59 @@ # WITHOUT ANY WARRANTY, to the extent permitted by law; without even the # implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. -include(${CMAKE_SOURCE_DIR}/cmake/macros/EnsureVersion.cmake) - -# User has manually chosen to ignore the git-tests, so we create an arbitrary string for the revisionhash/date as well -if(DISABLEGITCHECK) +# User has manually chosen to ignore the git-tests, so throw them a warning. +# This is done EACH compile so they can be alerted about the consequences. +if(WITHOUT_GIT) message(STATUS " - By choosing the DISABLEGITCHECK option, you waive all rights for support, and accept + By choosing the WITHOUT_GIT option, you waive all rights for support, and accept that any or all requests for assistance by you to core developers will be rejected. - You, as user, take full responsibility for issues, problems etc that might arise from using the core, as we we can not properly detect what codebase you're using. - We remind you that you need to use the repository and a proper version of git for the revision/hash to work, and thus get our support if the need arises. ") - - # Set an arbitrary date and hash, so we can match on that - set(rev_date "0000-00-00 00:00:00 +0000") - set(rev_hash "TC-COPY-WITH-NO-GIT-SUPPORT") + set(rev_date "1970-01-01 00:00:00 +0000") + set(rev_hash "Archived") else() - set(_REQUIRED_GIT_VERSION "1.7") - find_program(GIT_EXEC - NAMES - git git.cmd - HINTS - ENV PATH - DOC "Full path to git commandline client" - ) - MARK_AS_ADVANCED(GIT_EXEC) - - if(NOT GIT_EXEC) - message(FATAL_ERROR " - Git was NOT FOUND on your system - did you forget to install a recent version, or setting the path to it? - Observe that for revision hash/date to work you need at least version ${_REQUIRED_GIT_VERSION}") - else() - execute_process( - COMMAND "${GIT_EXEC}" --version - WORKING_DIRECTORY "${CMAKE_SOURCE_DIR}" - OUTPUT_VARIABLE _GIT_VERSION - ERROR_QUIET - ) - - # make sure we're using minimum the required version of git, so the "dirty-testing" will work properly - ensure_version( "${_REQUIRED_GIT_VERSION}" "${_GIT_VERSION}" _GIT_VERSION_OK) - - # throw an error if we don't have a recent enough version of git... - if(NOT _GIT_VERSION_OK) - message(FATAL_ERROR " - Git was found but is OUTDATED - did you forget to install a recent version, or setting the path to it? - Observe that for revision hash/date to work you need at least version ${_REQUIRED_GIT_VERSION}") - endif() + # Workaround for funny MSVC behaviour - this segment only run during compile + if(NOT BUILDDIR) + set(BUILDDIR ${CMAKE_BINARY_DIR}) + set(_GIT_EXEC ${GIT_EXECUTABLE}) endif() - if(_GIT_VERSION_OK) + if(_GIT_EXEC) + # Create a revision-string that we can use execute_process( - COMMAND "${GIT_EXEC}" describe --match init --dirty=+ --abbrev=12 + COMMAND "${_GIT_EXEC}" describe --match init --dirty=+ --abbrev=12 WORKING_DIRECTORY "${CMAKE_SOURCE_DIR}" OUTPUT_VARIABLE rev_info OUTPUT_STRIP_TRAILING_WHITESPACE ERROR_QUIET ) + + # And grab the commits timestamp execute_process( - COMMAND "${GIT_EXEC}" show -s --format=%ci + COMMAND "${_GIT_EXEC}" show -s --format=%ci WORKING_DIRECTORY "${CMAKE_SOURCE_DIR}" OUTPUT_VARIABLE rev_date OUTPUT_STRIP_TRAILING_WHITESPACE ERROR_QUIET ) endif() - - # Last minute check - ensure that we have a proper revision - # If everything above fails (means the user has erased the git revision control directory or removed the origin/HEAD tag) - if(NOT rev_info) - # No valid ways available to find/set the revision/hash, so let's force some defaults - message(STATUS "WARNING - Missing repository tags - you may need to pull tags with git fetch -t") - message(STATUS "WARNING - Continuing anyway - note that the versionstring will be set to 0000-00-00 00:00:00 (Archived)") - set(rev_date "0000-00-00 00:00:00 +0000") - set(rev_hash "Archived") - else() - # Extract information required to build a proper versionstring - string(REGEX REPLACE init-|[0-9]+-g "" rev_hash ${rev_info}) - endif() endif() -# Its not set during initial run -if(NOT BUILDDIR) - set(BUILDDIR ${CMAKE_BINARY_DIR}) +# Last minute check - ensure that we have a proper revision +# If everything above fails (means the user has erased the git revision control directory or removed the origin/HEAD tag) + +if(NOT rev_info) + # No valid ways available to find/set the revision/hash, so let's force some defaults + message(STATUS "WARNING - Missing repository tags - you may need to pull tags with git fetch -t") + message(STATUS "WARNING - Continuing anyway - note that the versionstring will be set to 0000-00-00 00:00:00 (Archived)") + set(rev_date "1970-01-01 00:00:00 +0000") + set(rev_hash "Archived") +else() + # Extract information required to build a proper versionstring + string(REGEX REPLACE init-|[0-9]+-g "" rev_hash ${rev_info}) endif() # Create the actual revision.h file from the above params diff --git a/cmake/macros/FindGit.cmake b/cmake/macros/FindGit.cmake new file mode 100644 index 0000000000..c23601dbcd --- /dev/null +++ b/cmake/macros/FindGit.cmake @@ -0,0 +1,46 @@ +# Copyright (C) 2008-2013 Trinity +# +# This file is free software; as a special exception the author gives +# unlimited permission to copy and/or distribute it, with or without +# modifications, as long as this notice is preserved. +# +# This program is distributed in the hope that it will be useful, but +# WITHOUT ANY WARRANTY, to the extent permitted by law; without even the +# implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. +include(${CMAKE_SOURCE_DIR}/cmake/macros/EnsureVersion.cmake) + +set(_REQUIRED_GIT_VERSION "1.7") + +find_program(GIT_EXECUTABLE + NAMES + git git.cmd + HINTS + ENV PATH + DOC "Full path to git commandline client" +) +MARK_AS_ADVANCED(GIT_EXECUTABLE) + +if(NOT GIT_EXECUTABLE) + message(FATAL_ERROR " + Git was NOT FOUND on your system - did you forget to install a recent version, or setting the path to it? + Observe that for revision hash/date to work you need at least version ${_REQUIRED_GIT_VERSION}") +else() + message(STATUS "Found git binary : ${GIT_EXECUTABLE}") + execute_process( + COMMAND "${GIT_EXECUTABLE}" --version + WORKING_DIRECTORY "${CMAKE_SOURCE_DIR}" + OUTPUT_VARIABLE _GIT_VERSION + ERROR_QUIET + ) + + # make sure we're using minimum the required version of git, so the "dirty-testing" will work properly + ensure_version( "${_REQUIRED_GIT_VERSION}" "${_GIT_VERSION}" _GIT_VERSION_OK) + + # throw an error if we don't have a recent enough version of git... + if(NOT _GIT_VERSION_OK) + message(STATUS "Git version too old : ${_GIT_VERSION}") + message(FATAL_ERROR " + Git was found but is OUTDATED - did you forget to install a recent version, or setting the path to it? + Observe that for revision hash/date to work you need at least version ${_REQUIRED_GIT_VERSION}") + endif() +endif() diff --git a/cmake/options.cmake b/cmake/options.cmake index 60b828abd7..ecd5801990 100644 --- a/cmake/options.cmake +++ b/cmake/options.cmake @@ -15,4 +15,4 @@ option(USE_SCRIPTPCH "Use precompiled headers when compiling scripts" option(USE_COREPCH "Use precompiled headers when compiling servers" 1) option(WITH_WARNINGS "Show all warnings during compile" 0) option(WITH_COREDEBUG "Include additional debug-code in core" 0) -option(DISABLEGITCHECK "Disable the GIT testing routines" 0) +option(WITHOUT_GIT "Disable the GIT testing routines" 0) diff --git a/src/genrev/CMakeLists.txt b/src/genrev/CMakeLists.txt index c01c57b636..d4486202b6 100644 --- a/src/genrev/CMakeLists.txt +++ b/src/genrev/CMakeLists.txt @@ -10,6 +10,6 @@ # Need to pass old ${CMAKE_BINARY_DIR} as param because its different at build stage add_custom_target(revision.h ALL - COMMAND ${CMAKE_COMMAND} -DBUILDDIR=${CMAKE_BINARY_DIR} -P ${CMAKE_SOURCE_DIR}/cmake/genrev.cmake + COMMAND ${CMAKE_COMMAND} -DGIT_EXEC=${GIT_EXECUTABLE} -DBUILDDIR=${CMAKE_BINARY_DIR} -P ${CMAKE_SOURCE_DIR}/cmake/genrev.cmake WORKING_DIRECTORY ${CMAKE_SOURCE_DIR} ) From 3178fc4d964dd3a3b599475d34d76742d843e9cf Mon Sep 17 00:00:00 2001 From: click Date: Mon, 11 Feb 2013 20:11:15 +0100 Subject: [PATCH 13/16] Buildsystem/CMake: Forgot to change variable in main CMakeLists.txt --- CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 9ea5b4825a..3b04269f1f 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -61,7 +61,7 @@ if( UNIX ) find_package(BZip2) endif() -if( NOT DISABLEGITCHECK ) +if( NOT WITHOUT_GIT ) find_package(Git) endif() From dfa56a33e08de755fa85184436ac8d946e928ab6 Mon Sep 17 00:00:00 2001 From: click Date: Mon, 11 Feb 2013 23:27:20 +0100 Subject: [PATCH 14/16] Buildsystem/CMake: Correct a few mistakes regarding WITHOUT_GIT, and add a better warning during configure-phase. --- CMakeLists.txt | 2 +- cmake/genrev.cmake | 54 ++++++++++++++++++----------------------- cmake/showoptions.cmake | 24 +++++++++++++++--- 3 files changed, 46 insertions(+), 34 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 3b04269f1f..72d1a225f2 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -61,7 +61,7 @@ if( UNIX ) find_package(BZip2) endif() -if( NOT WITHOUT_GIT ) +if(NOT WITHOUT_GIT) find_package(Git) endif() diff --git a/cmake/genrev.cmake b/cmake/genrev.cmake index a335ed2bd5..a2341b501a 100644 --- a/cmake/genrev.cmake +++ b/cmake/genrev.cmake @@ -10,57 +10,51 @@ # User has manually chosen to ignore the git-tests, so throw them a warning. # This is done EACH compile so they can be alerted about the consequences. + +if(NOT BUILDDIR) + # Workaround for funny MSVC behaviour - this segment only run during compile + set(GIT_EXEC ${GIT_EXECUTABLE}) + set(BUILDDIR ${CMAKE_BINARY_DIR}) +endif() + if(WITHOUT_GIT) - message(STATUS " - By choosing the WITHOUT_GIT option, you waive all rights for support, and accept - that any or all requests for assistance by you to core developers will be rejected. - You, as user, take full responsibility for issues, problems etc that might arise - from using the core, as we we can not properly detect what codebase you're using. - We remind you that you need to use the repository and a proper version of git for - the revision/hash to work, and thus get our support if the need arises. - ") set(rev_date "1970-01-01 00:00:00 +0000") set(rev_hash "Archived") else() - # Workaround for funny MSVC behaviour - this segment only run during compile - if(NOT BUILDDIR) - set(BUILDDIR ${CMAKE_BINARY_DIR}) - set(_GIT_EXEC ${GIT_EXECUTABLE}) - endif() - - if(_GIT_EXEC) + if(GIT_EXEC) # Create a revision-string that we can use execute_process( - COMMAND "${_GIT_EXEC}" describe --match init --dirty=+ --abbrev=12 + COMMAND "${GIT_EXEC}" describe --match init --dirty=+ --abbrev=12 WORKING_DIRECTORY "${CMAKE_SOURCE_DIR}" OUTPUT_VARIABLE rev_info OUTPUT_STRIP_TRAILING_WHITESPACE ERROR_QUIET ) - # And grab the commits timestamp + # And grab the commits timestamp execute_process( - COMMAND "${_GIT_EXEC}" show -s --format=%ci + COMMAND "${GIT_EXEC}" show -s --format=%ci WORKING_DIRECTORY "${CMAKE_SOURCE_DIR}" OUTPUT_VARIABLE rev_date OUTPUT_STRIP_TRAILING_WHITESPACE ERROR_QUIET ) endif() -endif() -# Last minute check - ensure that we have a proper revision -# If everything above fails (means the user has erased the git revision control directory or removed the origin/HEAD tag) + # Last minute check - ensure that we have a proper revision + # If everything above fails (means the user has erased the git revision control directory or removed the origin/HEAD tag) -if(NOT rev_info) - # No valid ways available to find/set the revision/hash, so let's force some defaults - message(STATUS "WARNING - Missing repository tags - you may need to pull tags with git fetch -t") - message(STATUS "WARNING - Continuing anyway - note that the versionstring will be set to 0000-00-00 00:00:00 (Archived)") - set(rev_date "1970-01-01 00:00:00 +0000") - set(rev_hash "Archived") -else() - # Extract information required to build a proper versionstring - string(REGEX REPLACE init-|[0-9]+-g "" rev_hash ${rev_info}) + if(NOT rev_info) + # No valid ways available to find/set the revision/hash, so let's force some defaults + message(STATUS " + Could not find a proper repository signature (hash) - you may need to pull tags with git fetch -t + Continuing anyway - note that the versionstring will be set to 1970-01-01 00:00:00 (Archived)") + set(rev_date "1970-01-01 00:00:00 +0000") + set(rev_hash "Archived") + else() + # Extract information required to build a proper versionstring + string(REGEX REPLACE init-|[0-9]+-g "" rev_hash ${rev_info}) + endif() endif() # Create the actual revision.h file from the above params diff --git a/cmake/showoptions.cmake b/cmake/showoptions.cmake index d3415e4e20..058cce78d0 100644 --- a/cmake/showoptions.cmake +++ b/cmake/showoptions.cmake @@ -72,10 +72,28 @@ if( WIN32 ) endif() endif( WIN32 ) +if ( WITHOUT_GIT ) + message("* Use GIT revision hash : No") + message("") + message(" *** WITHOUT_GIT - WARNING!") + message(" *** By choosing the WITHOUT_GIT option you have waived all rights for support,") + message(" *** and accept that or all requests for support or assistance sent to the core") + message(" *** developers will be rejected. This due to that we will be unable to detect") + message(" *** what revision of the codebase you are using in a proper way.") + message(" *** We remind you that you need to use the repository codebase and a supported") + message(" *** version of git for the revision-hash to work, and be allowede to ask for") + message(" *** support if needed.") +else() + message("* Use GIT revision hash : Yes") +endif() + if ( NOJEM ) message("") - message("*** WARNING: jemalloc linking has been disabled!") - message("*** Please note that this is for DEBUGGING WITH VALGRIND only!") - message("*** DO NOT DISABLE IT UNLESS YOU KNOW WHAT YOU'RE DOING!") + message(" *** NOJEM - WARNING!") + message(" *** jemalloc linking has been disabled!") + message(" *** Please note that this is for DEBUGGING WITH VALGRIND only!") + message(" *** DO NOT DISABLE IT UNLESS YOU KNOW WHAT YOU'RE DOING!") endif() + message("") + From 1ff184dbab73492c3541a960bd720863a05c1cc2 Mon Sep 17 00:00:00 2001 From: Shauren Date: Tue, 12 Feb 2013 12:21:24 +0100 Subject: [PATCH 15/16] Buildsystem: Do not print warning that user needs to do a git pull with tags if configured to not use git at all --- cmake/genrev.cmake | 3 ++- src/genrev/CMakeLists.txt | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/cmake/genrev.cmake b/cmake/genrev.cmake index a2341b501a..35f1a7a11e 100644 --- a/cmake/genrev.cmake +++ b/cmake/genrev.cmake @@ -13,11 +13,12 @@ if(NOT BUILDDIR) # Workaround for funny MSVC behaviour - this segment only run during compile + set(NO_GIT ${WITHOUT_GIT}) set(GIT_EXEC ${GIT_EXECUTABLE}) set(BUILDDIR ${CMAKE_BINARY_DIR}) endif() -if(WITHOUT_GIT) +if(NO_GIT) set(rev_date "1970-01-01 00:00:00 +0000") set(rev_hash "Archived") else() diff --git a/src/genrev/CMakeLists.txt b/src/genrev/CMakeLists.txt index d4486202b6..b54534af82 100644 --- a/src/genrev/CMakeLists.txt +++ b/src/genrev/CMakeLists.txt @@ -10,6 +10,6 @@ # Need to pass old ${CMAKE_BINARY_DIR} as param because its different at build stage add_custom_target(revision.h ALL - COMMAND ${CMAKE_COMMAND} -DGIT_EXEC=${GIT_EXECUTABLE} -DBUILDDIR=${CMAKE_BINARY_DIR} -P ${CMAKE_SOURCE_DIR}/cmake/genrev.cmake + COMMAND ${CMAKE_COMMAND} -DNO_GIT=${WITHOUT_GIT} -DGIT_EXEC=${GIT_EXECUTABLE} -DBUILDDIR=${CMAKE_BINARY_DIR} -P ${CMAKE_SOURCE_DIR}/cmake/genrev.cmake WORKING_DIRECTORY ${CMAKE_SOURCE_DIR} ) From 20cd6cfc61414c47a6ed784e62f967ca6b44960e Mon Sep 17 00:00:00 2001 From: Shauren Date: Tue, 12 Feb 2013 12:39:48 +0100 Subject: [PATCH 16/16] Scripts/Icecrown Citadel: Fixed possible crash for Necrotic Plague (if cast outside of ICC) Closes #9188 --- .../scripts/Northrend/IcecrownCitadel/boss_the_lich_king.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/server/scripts/Northrend/IcecrownCitadel/boss_the_lich_king.cpp b/src/server/scripts/Northrend/IcecrownCitadel/boss_the_lich_king.cpp index fb1415aa60..b040ff17c3 100644 --- a/src/server/scripts/Northrend/IcecrownCitadel/boss_the_lich_king.cpp +++ b/src/server/scripts/Northrend/IcecrownCitadel/boss_the_lich_king.cpp @@ -2178,7 +2178,8 @@ class spell_the_lich_king_necrotic_plague_jump : public SpellScriptLoader void OnApply(AuraEffect const* /*aurEff*/, AuraEffectHandleModes /*mode*/) { if (Unit* caster = GetCaster()) - caster->GetAI()->SetData(DATA_PLAGUE_STACK, GetStackAmount()); + if (caster->GetAI()) + caster->GetAI()->SetData(DATA_PLAGUE_STACK, GetStackAmount()); } void OnRemove(AuraEffect const* aurEff, AuraEffectHandleModes /*mode*/)