diff --git a/CMakeLists.txt b/CMakeLists.txt index aa7eb9b2..5d47c595 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -2,7 +2,7 @@ cmake_minimum_required(VERSION 3.18) project(Darkflame) include(CTest) -set (CMAKE_CXX_STANDARD 17) +set(CMAKE_CXX_STANDARD 20) # Read variables from file FILE(READ "${CMAKE_SOURCE_DIR}/CMakeVariables.txt" variables) diff --git a/dGame/UserManager.cpp b/dGame/UserManager.cpp index 18387366..9afd38b2 100644 --- a/dGame/UserManager.cpp +++ b/dGame/UserManager.cpp @@ -263,7 +263,7 @@ void UserManager::CreateCharacter(const SystemAddress& sysAddr, Packet* packet) } //Now that the name is ok, we can get an objectID from Master: - ObjectIDManager::Instance()->RequestPersistentID([=](uint32_t objectID) { + ObjectIDManager::Instance()->RequestPersistentID([=, this](uint32_t objectID) { if (Database::Get()->GetCharacterInfo(objectID)) { LOG("Character object id unavailable, check object_id_tracker!"); WorldPackets::SendCharacterCreationResponse(sysAddr, eCharacterCreationResponse::OBJECT_ID_UNAVAILABLE); diff --git a/dGame/dComponents/ActivityComponent.cpp b/dGame/dComponents/ActivityComponent.cpp index f4865a03..55bc4c08 100644 --- a/dGame/dComponents/ActivityComponent.cpp +++ b/dGame/dComponents/ActivityComponent.cpp @@ -33,7 +33,7 @@ ActivityComponent::ActivityComponent(Entity* parent, int32_t activityID) : Compo if (activityID > 0) m_ActivityID = activityID; else m_ActivityID = parent->GetVar(u"activityID"); CDActivitiesTable* activitiesTable = CDClientManager::Instance().GetTable(); - std::vector activities = activitiesTable->Query([=](CDActivities entry) {return (entry.ActivityID == m_ActivityID); }); + std::vector activities = activitiesTable->Query([this](CDActivities entry) {return (entry.ActivityID == m_ActivityID); }); for (CDActivities activity : activities) { m_ActivityInfo = activity; @@ -93,7 +93,7 @@ void ActivityComponent::Serialize(RakNet::BitStream* outBitStream, bool bIsIniti void ActivityComponent::ReloadConfig() { CDActivitiesTable* activitiesTable = CDClientManager::Instance().GetTable(); - std::vector activities = activitiesTable->Query([=](CDActivities entry) {return (entry.ActivityID == m_ActivityID); }); + std::vector activities = activitiesTable->Query([this](CDActivities entry) {return (entry.ActivityID == m_ActivityID); }); for (auto activity : activities) { auto mapID = m_ActivityInfo.instanceMapID; if (static_cast(activity.leaderboardType) == Leaderboard::Type::Racing && Game::config->GetValue("solo_racing") == "1") { @@ -532,7 +532,7 @@ void ActivityInstance::RewardParticipant(Entity* participant) { // First, get the activity data auto* activityRewardsTable = CDClientManager::Instance().GetTable(); - std::vector activityRewards = activityRewardsTable->Query([=](CDActivityRewards entry) { return (entry.objectTemplate == m_ActivityInfo.ActivityID); }); + std::vector activityRewards = activityRewardsTable->Query([this](CDActivityRewards entry) { return (entry.objectTemplate == m_ActivityInfo.ActivityID); }); if (!activityRewards.empty()) { uint32_t minCoins = 0; diff --git a/dGame/dComponents/RacingControlComponent.cpp b/dGame/dComponents/RacingControlComponent.cpp index ef1d0f32..5b93dbb7 100644 --- a/dGame/dComponents/RacingControlComponent.cpp +++ b/dGame/dComponents/RacingControlComponent.cpp @@ -312,7 +312,7 @@ void RacingControlComponent::OnRequestDie(Entity* player) { } // Respawn the player in 2 seconds, as was done in live. Not sure if this value is in a setting somewhere else... - vehicle->AddCallbackTimer(2.0f, [=]() { + vehicle->AddCallbackTimer(2.0f, [=, this]() { if (!vehicle || !this->m_Parent) return; GameMessages::SendRacingResetPlayerToLastReset( m_Parent->GetObjectID(), racingPlayer.playerID, diff --git a/dGame/dInventory/Item.cpp b/dGame/dInventory/Item.cpp index 06c6900f..e68cdebc 100644 --- a/dGame/dInventory/Item.cpp +++ b/dGame/dInventory/Item.cpp @@ -249,7 +249,7 @@ bool Item::IsEquipped() const { bool Item::Consume() { auto* skillsTable = CDClientManager::Instance().GetTable(); - auto skills = skillsTable->Query([=](const CDObjectSkills entry) { + auto skills = skillsTable->Query([this](const CDObjectSkills entry) { return entry.objectTemplate == static_cast(lot); }); diff --git a/dZoneManager/Spawner.cpp b/dZoneManager/Spawner.cpp index b602c17c..31188907 100644 --- a/dZoneManager/Spawner.cpp +++ b/dZoneManager/Spawner.cpp @@ -51,20 +51,20 @@ Spawner::Spawner(const SpawnerInfo info) { std::vector spawnSmashSpawnersN = Game::zoneManager->GetSpawnersByName(m_Info.spawnOnSmashGroupName); for (Entity* ssEntity : spawnSmashEntities) { m_SpawnSmashFoundGroup = true; - ssEntity->AddDieCallback([=]() { + ssEntity->AddDieCallback([=, this]() { Spawn(); }); } for (Spawner* ssSpawner : spawnSmashSpawners) { m_SpawnSmashFoundGroup = true; - ssSpawner->AddSpawnedEntityDieCallback([=]() { + ssSpawner->AddSpawnedEntityDieCallback([=, this]() { Spawn(); }); } for (Spawner* ssSpawner : spawnSmashSpawnersN) { m_SpawnSmashFoundGroup = true; m_SpawnOnSmash = ssSpawner; - ssSpawner->AddSpawnedEntityDieCallback([=]() { + ssSpawner->AddSpawnedEntityDieCallback([=, this]() { Spawn(); }); } diff --git a/tests/dCommonTests/TestEncoding.cpp b/tests/dCommonTests/TestEncoding.cpp index c103ccbf..54ae03d3 100644 --- a/tests/dCommonTests/TestEncoding.cpp +++ b/tests/dCommonTests/TestEncoding.cpp @@ -26,7 +26,7 @@ TEST_F(EncodingTest, TestEncodingHello) { }; TEST_F(EncodingTest, TestEncodingUmlaut) { - originalWord = u8"Frühling"; + originalWord = reinterpret_cast(u8"Frühling"); originalWordSv = originalWord; GeneralUtils::_NextUTF8Char(originalWordSv, out); EXPECT_EQ(out, U'F'); diff --git a/thirdparty/raknet/CMakeLists.txt b/thirdparty/raknet/CMakeLists.txt index 417e24dd..d4dd1e60 100644 --- a/thirdparty/raknet/CMakeLists.txt +++ b/thirdparty/raknet/CMakeLists.txt @@ -80,6 +80,8 @@ target_compile_options(raknet PRIVATE $<$: /w>) +set_property(TARGET raknet PROPERTY CXX_STANDARD 17) + if(WIN32) # Link Win Sockets 2 to RakNet target_link_libraries(raknet ws2_32)