Core/Misc: buildfix

This commit is contained in:
Ovahlord committed 2025-08-05 20:36:37 +02:00
1 parent 594002faa6
commit 3ef6132fce
11 files changed
+70 -25

No files matched your search

+1 -5
View File
@@ -18,16 +18,12 @@ jobs:
run: |
mkdir bin
cd bin
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
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
cd ..
- name: Build
run: |
cd bin
make -j 4 -k && make install
- name: Unit tests
run: |
cd bin
make test
- name: Check executables
run: |
cd bin/check_install/bin
-4
View File
@@ -23,10 +23,6 @@ jobs:
run: |
cd bin
make -j 4 -k && make install
- name: Unit tests
run: |
cd bin
make test
- name: Check executables
run: |
cd bin/check_install/bin
@@ -0,0 +1,6 @@
UPDATE `world_state` SET `MapIDs`= '30' WHERE `MapIDs`= '30,2197';
UPDATE `world_state` SET `MapIDs`= '489,726' WHERE `MapIDs`= '489,726,2106';
UPDATE `world_state` SET `MapIDs`= '489' WHERE `MapIDs`= '489,2106';
UPDATE `world_state` SET `MapIDs`= '529,566,761,968' WHERE `MapIDs`= '529,566,761,968,1105,1681,2107,2177';
UPDATE `world_state` SET `MapIDs`= '529,566,761,968' WHERE `MapIDs`= '529,761,1681,2107,2177';
UPDATE `world_state` SET `MapIDs`= '529' WHERE `MapIDs`= '529,1681,2107,2177';
+5
View File
@@ -626,6 +626,11 @@ void Trinity::Impl::HexStrToByteArray(std::string_view str, uint8* out, size_t o
}
}
bool StringEqualI(std::string_view a, std::string_view b)
{
return std::ranges::equal(a, b, {}, charToLower, charToLower);
}
bool StringToBool(std::string const& str)
{
std::string lowerStr = str;
+12
View File
@@ -269,6 +269,16 @@ inline wchar_t wcharToLower(wchar_t wchar)
return wchar;
}
struct CharToUpper
{
char operator()(char c) const { return std::toupper(static_cast<unsigned char>(c)); }
} inline constexpr charToUpper;
struct CharToLower
{
char operator()(char c) const { return std::tolower(static_cast<unsigned char>(c)); }
} inline constexpr charToLower;
TC_COMMON_API void wstrToUpper(std::wstring& str);
TC_COMMON_API void wstrToLower(std::wstring& str);
@@ -326,6 +336,8 @@ TC_COMMON_API bool StringContainsStringI(std::string const& haystack, std::strin
TC_COMMON_API float DegToRad(float degrees);
TC_COMMON_API bool StringEqualI(std::string_view str1, std::string_view str2);
template<class Container>
std::string StringJoin(Container const& c, std::string delimiter)
{
+7 -7
View File
@@ -1528,13 +1528,13 @@ struct SkillLineAbilityEntry
struct SkillRaceClassInfoEntry
{
//uint32 ID; // 0
uint32 SkillID; // 1
uint32 RaceMask; // 2
uint32 ClassMask; // 3
uint32 Flags; // 4
uint32 Availability; // 5
uint32 MinLevel; // 6
uint32 SkillTierID; // 7
int32 SkillID; // 1
int32 RaceMask; // 2
int32 ClassMask; // 3
int32 Flags; // 4
int32 Availability; // 5
int32 MinLevel; // 6
int32 SkillTierID; // 7
//uint32 SkillCostIndex; // 8
};
+2 -2
View File
@@ -8103,7 +8103,7 @@ void Player::CastItemUseSpell(Item* item, SpellCastTargets const& targets, uint8
Spell* spell = new Spell(this, spellInfo, TRIGGERED_NONE);
spell->m_CastItem = item;
spell->m_cast_count = castId;
spell->SetSpellValue({ SPELLVALUE_BASE_POINT0, learning_spell_id });
spell->SetSpellValue({ SPELLVALUE_BASE_POINT0, static_cast<int32>(learning_spell_id) });
spell->prepare(targets);
return;
}
@@ -23351,7 +23351,7 @@ void Player::LearnSkillRewardedSpells(uint32 skillId, uint32 skillValue)
continue;
// need unlearn spell
if (int32(skillValue) < ability->MinSkillLineRank && ability->GetAcquireMethod() == SkillLineAbilityAcquireMethod::AutomaticSkillRank)
if (skillValue < ability->MinSkillLineRank && ability->GetAcquireMethod() == SkillLineAbilityAcquireMethod::AutomaticSkillRank)
RemoveSpell(ability->Spell);
// need learn
+1 -1
View File
@@ -7849,7 +7849,7 @@ void ObjectMgr::LoadQuestPOI()
else
{
// Some POIs can reference empty blobs according to sniff data
poiData.Blobs.emplace_back(blobIndex, objectiveIndex, mapID, worldMapAreaID, floor, priority, flags, std::move(std::vector<QuestPOIBlobPoint>()));
poiData.Blobs.emplace_back(blobIndex, objectiveIndex, mapID, worldMapAreaID, floor, priority, flags, std::vector<QuestPOIBlobPoint>());
}
}
+1 -1
View File
@@ -1132,7 +1132,7 @@ void WorldSession::HandleSetTitleOpcode(WorldPacket& recvData)
recvData >> title;
// -1 at none
if (title > 0 && title < MAX_TITLE_INDEX)
if (title > 0)
{
if (!GetPlayer()->HasTitle(title))
return;
+1 -1
View File
@@ -693,7 +693,7 @@ void PoolMgr::LoadFromDB()
// Now check for circular reference
// All pool_ids are in pool_template
for (auto const it : mPoolTemplate)
for (auto const& it : mPoolTemplate)
{
std::set<uint32> checkedPools;
for (SearchMap::iterator poolItr = mPoolSearchMap.find(it.first); poolItr != mPoolSearchMap.end(); poolItr = mPoolSearchMap.find(poolItr->second))
@@ -483,7 +483,7 @@ void AuraEffect::GetApplicationList(Container& applicationContainer) const
int32 AuraEffect::CalculateAmount(Unit* caster)
{
// default amount calculation
int32 amount = amount = m_spellInfo->Effects[m_effIndex].CalcValue(caster, &m_baseAmount, GetBase()->GetOwner()->ToUnit());;
int32 amount = m_spellInfo->Effects[m_effIndex].CalcValue(caster, &m_baseAmount, GetBase()->GetOwner()->ToUnit());;
// check item enchant aura cast
if (!amount && caster)
@@ -581,6 +581,8 @@ int32 AuraEffect::CalculateAmount(Unit* caster)
case 90363: // Embrace of the Shale Spider
amount = resist / 2;
break;
default:
break;
}
break;
}
@@ -1420,6 +1422,8 @@ void AuraEffect::HandleShapeshiftBoosts(Unit* target, bool apply) const
case 33873:
spellId3 = 47180;
break;
default:
break;
}
target->CastSpell(target, spellId3, this);
}
@@ -2538,7 +2542,7 @@ void AuraEffect::HandleAuraModPacifyAndSilence(AuraApplication const* aurApp, ui
Unit* target = aurApp->GetTarget();
// Vengeance of the Blue Flight (@todo REMOVE THIS!)
// Vengeance of the Blue Flight (@todo REMOVE THIS!)5402
/// @workaround
if (m_spellInfo->Id == 45839)
{
@@ -4634,6 +4638,8 @@ void AuraEffect::HandleAuraDummy(AuraApplication const* aurApp, uint8 mode, bool
if (caster)
target->GetMotionMaster()->MoveFall();
break;
default:
break;
}
}
// AT REMOVE
@@ -4662,6 +4668,8 @@ void AuraEffect::HandleAuraDummy(AuraApplication const* aurApp, uint8 mode, bool
case 30099: finalSpelId = 30100; break;
case 30102: finalSpelId = 30103; break;
case 30105: finalSpelId = 30104; break;
default:
break;
}
if (finalSpelId)
@@ -4709,6 +4717,8 @@ void AuraEffect::HandleAuraDummy(AuraApplication const* aurApp, uint8 mode, bool
if (aurApp->GetRemoveMode().HasFlag(AuraRemoveFlags::Expired))
target->CastSpell(target, 58601, true);
break;
default:
break;
}
break;
case SPELLFAMILY_DEATHKNIGHT:
@@ -4793,7 +4803,7 @@ void AuraEffect::HandleAuraDummy(AuraApplication const* aurApp, uint8 mode, bool
case 93806: // Darnassus Champion
case 93811: // Exodar Champion
case 93805: // Ironforge Champion
case 93795: // Sturmwind Champion
case 93795: // Stormwind Champion
{
if (!caster || caster->GetTypeId() != TYPEID_PLAYER)
break;
@@ -4825,7 +4835,9 @@ void AuraEffect::HandleAuraDummy(AuraApplication const* aurApp, uint8 mode, bool
case 93806: FactionID = 69; break; // Darnassus Champion
case 93811: FactionID = 930; break; // Exodar Champion
case 93805: FactionID = 47; break; // Ironforge Champion
case 93795: FactionID = 72; break; // Sturmwind Champion
case 93795: FactionID = 72; break; // Stormwind Champion
default:
break;
}
}
caster->ToPlayer()->SetChampioningFaction(FactionID);
@@ -4877,6 +4889,8 @@ void AuraEffect::HandleAuraDummy(AuraApplication const* aurApp, uint8 mode, bool
}
}
break;
default:
break;
}
break;
@@ -4915,6 +4929,8 @@ void AuraEffect::HandleAuraDummy(AuraApplication const* aurApp, uint8 mode, bool
// break;
break;
}
default:
break;
}
}
@@ -5332,6 +5348,8 @@ void AuraEffect::HandlePeriodicDummyAuraTick(Unit* target, Unit* caster) const
target->RemoveAura(64821);
}
break;
default:
break;
}
break;
case SPELLFAMILY_HUNTER:
@@ -5378,9 +5396,13 @@ void AuraEffect::HandlePeriodicDummyAuraTick(Unit* target, Unit* caster) const
switch (GetId())
{
case 49016: // Hysteria
{
uint32 damage = uint32(target->CountPctFromMaxHealth(1));
Unit::DealDamage(target, target, damage, 0, NODAMAGE, SPELL_SCHOOL_MASK_NORMAL, nullptr, false);
break;
}
default:
break;
}
// Blood of the North
// Reaping
@@ -5550,6 +5572,8 @@ void AuraEffect::HandlePeriodicTriggerSpellAuraTick(Unit* target, Unit* caster)
case 46736:
triggerSpellId = 46737;
break;
default:
break;
}
break;
}
@@ -5565,6 +5589,8 @@ void AuraEffect::HandlePeriodicTriggerSpellAuraTick(Unit* target, Unit* caster)
target->RemoveAurasDueToSpell(28820);
return;
}
default:
break;
}
break;
}
@@ -5663,6 +5689,8 @@ void AuraEffect::HandlePeriodicTriggerSpellAuraTick(Unit* target, Unit* caster)
caster->CastSpell(target, triggerSpellId, false);
return;
}
default:
break;
}
}
@@ -5743,6 +5771,8 @@ void AuraEffect::HandlePeriodicDamageAurasTick(Unit* target, Unit* caster) const
}
break;
}
default:
break;
}
}