Skip to content

Commit 3ef6132

Browse files
committed
Core/Misc: buildfix
1 parent 594002f commit 3ef6132

11 files changed

Lines changed: 70 additions & 25 deletions

File tree

.github/workflows/clang-build.yml

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -18,16 +18,12 @@ jobs:
1818
run: |
1919
mkdir bin
2020
cd bin
21-
cmake ../ -DWITH_WARNINGS=1 -DWITH_COREDEBUG=0 -DUSE_COREPCH=1 -DUSE_SCRIPTPCH=1 -DTOOLS=1 -DSCRIPTS=static -DSERVERS=1 -DNOJEM=0 -DCMAKE_BUILD_TYPE=Debug -DCMAKE_C_COMPILER=clang-11 -DCMAKE_CXX_COMPILER=clang++-11 -DCMAKE_C_FLAGS="-Werror" -DCMAKE_CXX_FLAGS="-Werror" -DCMAKE_C_FLAGS_DEBUG="-DNDEBUG" -DCMAKE_CXX_FLAGS_DEBUG="-DNDEBUG" -DCMAKE_INSTALL_PREFIX=check_install -DBUILD_TESTING=0
21+
cmake ../ -DWITH_WARNINGS=1 -DWITH_COREDEBUG=0 -DUSE_COREPCH=1 -DUSE_SCRIPTPCH=1 -DTOOLS=1 -DSCRIPTS=static -DSERVERS=1 -DNOJEM=0 -DCMAKE_BUILD_TYPE=Debug -DCMAKE_C_COMPILER=clang -DCMAKE_CXX_COMPILER=clang++ -DCMAKE_C_FLAGS="-Werror" -DCMAKE_CXX_FLAGS="-Werror" -DCMAKE_C_FLAGS_DEBUG="-DNDEBUG" -DCMAKE_CXX_FLAGS_DEBUG="-DNDEBUG" -DCMAKE_INSTALL_PREFIX=check_install -DBUILD_TESTING=0
2222
cd ..
2323
- name: Build
2424
run: |
2525
cd bin
2626
make -j 4 -k && make install
27-
- name: Unit tests
28-
run: |
29-
cd bin
30-
make test
3127
- name: Check executables
3228
run: |
3329
cd bin/check_install/bin

.github/workflows/gcc-build.yml

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -23,10 +23,6 @@ jobs:
2323
run: |
2424
cd bin
2525
make -j 4 -k && make install
26-
- name: Unit tests
27-
run: |
28-
cd bin
29-
make test
3026
- name: Check executables
3127
run: |
3228
cd bin/check_install/bin
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
UPDATE `world_state` SET `MapIDs`= '30' WHERE `MapIDs`= '30,2197';
2+
UPDATE `world_state` SET `MapIDs`= '489,726' WHERE `MapIDs`= '489,726,2106';
3+
UPDATE `world_state` SET `MapIDs`= '489' WHERE `MapIDs`= '489,2106';
4+
UPDATE `world_state` SET `MapIDs`= '529,566,761,968' WHERE `MapIDs`= '529,566,761,968,1105,1681,2107,2177';
5+
UPDATE `world_state` SET `MapIDs`= '529,566,761,968' WHERE `MapIDs`= '529,761,1681,2107,2177';
6+
UPDATE `world_state` SET `MapIDs`= '529' WHERE `MapIDs`= '529,1681,2107,2177';

src/common/Utilities/Util.cpp

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -626,6 +626,11 @@ void Trinity::Impl::HexStrToByteArray(std::string_view str, uint8* out, size_t o
626626
}
627627
}
628628

629+
bool StringEqualI(std::string_view a, std::string_view b)
630+
{
631+
return std::ranges::equal(a, b, {}, charToLower, charToLower);
632+
}
633+
629634
bool StringToBool(std::string const& str)
630635
{
631636
std::string lowerStr = str;

src/common/Utilities/Util.h

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -269,6 +269,16 @@ inline wchar_t wcharToLower(wchar_t wchar)
269269
return wchar;
270270
}
271271

272+
struct CharToUpper
273+
{
274+
char operator()(char c) const { return std::toupper(static_cast<unsigned char>(c)); }
275+
} inline constexpr charToUpper;
276+
277+
struct CharToLower
278+
{
279+
char operator()(char c) const { return std::tolower(static_cast<unsigned char>(c)); }
280+
} inline constexpr charToLower;
281+
272282
TC_COMMON_API void wstrToUpper(std::wstring& str);
273283
TC_COMMON_API void wstrToLower(std::wstring& str);
274284

@@ -326,6 +336,8 @@ TC_COMMON_API bool StringContainsStringI(std::string const& haystack, std::strin
326336

327337
TC_COMMON_API float DegToRad(float degrees);
328338

339+
TC_COMMON_API bool StringEqualI(std::string_view str1, std::string_view str2);
340+
329341
template<class Container>
330342
std::string StringJoin(Container const& c, std::string delimiter)
331343
{

src/server/game/DataStores/DBCStructure.h

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1528,13 +1528,13 @@ struct SkillLineAbilityEntry
15281528
struct SkillRaceClassInfoEntry
15291529
{
15301530
//uint32 ID; // 0
1531-
uint32 SkillID; // 1
1532-
uint32 RaceMask; // 2
1533-
uint32 ClassMask; // 3
1534-
uint32 Flags; // 4
1535-
uint32 Availability; // 5
1536-
uint32 MinLevel; // 6
1537-
uint32 SkillTierID; // 7
1531+
int32 SkillID; // 1
1532+
int32 RaceMask; // 2
1533+
int32 ClassMask; // 3
1534+
int32 Flags; // 4
1535+
int32 Availability; // 5
1536+
int32 MinLevel; // 6
1537+
int32 SkillTierID; // 7
15381538
//uint32 SkillCostIndex; // 8
15391539
};
15401540

src/server/game/Entities/Player/Player.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8103,7 +8103,7 @@ void Player::CastItemUseSpell(Item* item, SpellCastTargets const& targets, uint8
81038103
Spell* spell = new Spell(this, spellInfo, TRIGGERED_NONE);
81048104
spell->m_CastItem = item;
81058105
spell->m_cast_count = castId;
8106-
spell->SetSpellValue({ SPELLVALUE_BASE_POINT0, learning_spell_id });
8106+
spell->SetSpellValue({ SPELLVALUE_BASE_POINT0, static_cast<int32>(learning_spell_id) });
81078107
spell->prepare(targets);
81088108
return;
81098109
}
@@ -23351,7 +23351,7 @@ void Player::LearnSkillRewardedSpells(uint32 skillId, uint32 skillValue)
2335123351
continue;
2335223352

2335323353
// need unlearn spell
23354-
if (int32(skillValue) < ability->MinSkillLineRank && ability->GetAcquireMethod() == SkillLineAbilityAcquireMethod::AutomaticSkillRank)
23354+
if (skillValue < ability->MinSkillLineRank && ability->GetAcquireMethod() == SkillLineAbilityAcquireMethod::AutomaticSkillRank)
2335523355
RemoveSpell(ability->Spell);
2335623356

2335723357
// need learn

src/server/game/Globals/ObjectMgr.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7849,7 +7849,7 @@ void ObjectMgr::LoadQuestPOI()
78497849
else
78507850
{
78517851
// Some POIs can reference empty blobs according to sniff data
7852-
poiData.Blobs.emplace_back(blobIndex, objectiveIndex, mapID, worldMapAreaID, floor, priority, flags, std::move(std::vector<QuestPOIBlobPoint>()));
7852+
poiData.Blobs.emplace_back(blobIndex, objectiveIndex, mapID, worldMapAreaID, floor, priority, flags, std::vector<QuestPOIBlobPoint>());
78537853
}
78547854
}
78557855

src/server/game/Handlers/MiscHandler.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1132,7 +1132,7 @@ void WorldSession::HandleSetTitleOpcode(WorldPacket& recvData)
11321132
recvData >> title;
11331133

11341134
// -1 at none
1135-
if (title > 0 && title < MAX_TITLE_INDEX)
1135+
if (title > 0)
11361136
{
11371137
if (!GetPlayer()->HasTitle(title))
11381138
return;

src/server/game/Pools/PoolMgr.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -693,7 +693,7 @@ void PoolMgr::LoadFromDB()
693693

694694
// Now check for circular reference
695695
// All pool_ids are in pool_template
696-
for (auto const it : mPoolTemplate)
696+
for (auto const& it : mPoolTemplate)
697697
{
698698
std::set<uint32> checkedPools;
699699
for (SearchMap::iterator poolItr = mPoolSearchMap.find(it.first); poolItr != mPoolSearchMap.end(); poolItr = mPoolSearchMap.find(poolItr->second))

0 commit comments

Comments
 (0)