Skip to content

Commit 18f4157

Browse files
author
acidmanifesto
authored
Merge pull request #26 from Nefertumm/buildFix
Fix: build
2 parents a59a702 + b49de14 commit 18f4157

File tree

1 file changed

+15
-15
lines changed

1 file changed

+15
-15
lines changed

src/Solocraft.cpp

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
#include <map>
1+
#include <map>
22
#include "Log.h"
33
#include "Config.h"
44
#include "ScriptMgr.h"
@@ -322,11 +322,11 @@ class SolocraftAnnounce : public PlayerScript
322322
void OnLogout(Player* player)
323323
{
324324
//Database query to see if an entry is still there
325-
QueryResult result = CharacterDatabase.PQuery("SELECT `GUID` FROM `custom_solocraft_character_stats` WHERE GUID = %u", player->GetGUID().GetCounter());
325+
QueryResult result = CharacterDatabase.Query("SELECT `GUID` FROM `custom_solocraft_character_stats` WHERE GUID = {}", player->GetGUID().GetCounter());
326326
if (result)
327327
{
328328
//Remove database entry as the player has logged out
329-
CharacterDatabase.PExecute("DELETE FROM custom_solocraft_character_stats WHERE GUID = %u", player->GetGUID().GetCounter());
329+
CharacterDatabase.Execute("DELETE FROM custom_solocraft_character_stats WHERE GUID = {}", player->GetGUID().GetCounter());
330330
}
331331
}
332332
};
@@ -471,15 +471,15 @@ class solocraft_player_instance_handler : public PlayerScript {
471471
}
472472

473473
//Check Database for a current dungeon entry
474-
QueryResult result = CharacterDatabase.PQuery("SELECT `GUID`, `Difficulty`, `GroupSize`, `SpellPower`, `Stats` FROM `custom_solocraft_character_stats` WHERE GUID = %u", player->GetGUID().GetCounter());
474+
QueryResult result = CharacterDatabase.Query("SELECT `GUID`, `Difficulty`, `GroupSize`, `SpellPower`, `Stats` FROM `custom_solocraft_character_stats` WHERE GUID = {}", player->GetGUID().GetCounter());
475475

476476
//Modify Player Stats
477477
for (int32 i = STAT_STRENGTH; i < MAX_STATS; ++i) //STATS defined/enum in SharedDefines.h
478478
{
479479
//Check for Dungeon to Dungeon Transfer and remove old buff
480480
if (result)
481481
{
482-
player->HandleStatModifier(UnitMods(UNIT_MOD_STAT_START + i), TOTAL_PCT, (*result)[1].GetFloat() * (*result)[4].GetFloat(), false);
482+
player->HandleStatModifier(UnitMods(UNIT_MOD_STAT_START + i), TOTAL_PCT, (*result)[1].Get<float>() * (*result)[4].Get<float>(), false);
483483
}
484484
// Buff the player
485485
player->HandleStatModifier(UnitMods(UNIT_MOD_STAT_START + i), TOTAL_PCT, difficulty * SoloCraftStatsMult, true); //Unitmods enum UNIT_MOD_STAT_START defined in Unit.h line 391
@@ -499,7 +499,7 @@ class solocraft_player_instance_handler : public PlayerScript {
499499
if (result)
500500
{
501501
// remove spellpower bonus
502-
player->ApplySpellPowerBonus((*result)[3].GetUInt32() * (*result)[4].GetFloat(),false);
502+
player->ApplySpellPowerBonus((*result)[3].Get<uint32>() * (*result)[4].Get<float>(),false);
503503
}
504504

505505
//Buff Spellpower
@@ -527,7 +527,7 @@ class solocraft_player_instance_handler : public PlayerScript {
527527
}
528528

529529
// Save Player Dungeon Offsets to Database
530-
CharacterDatabase.PExecute("REPLACE INTO custom_solocraft_character_stats (GUID, Difficulty, GroupSize, SpellPower, Stats) VALUES (%u, %f, %u, %i, %f)", player->GetGUID().GetCounter(), difficulty, numInGroup, SpellPowerBonus, SoloCraftStatsMult);
530+
CharacterDatabase.Execute("REPLACE INTO custom_solocraft_character_stats (GUID, Difficulty, GroupSize, SpellPower, Stats) VALUES ({}, {}, {}, {}, {})", player->GetGUID().GetCounter(), difficulty, numInGroup, SpellPowerBonus, SoloCraftStatsMult);
531531
}
532532
else
533533
{
@@ -556,13 +556,13 @@ class solocraft_player_instance_handler : public PlayerScript {
556556
if (itr->guid != player->GetGUID())
557557
{
558558
//Database query to find difficulty for each group member that is currently in an instance
559-
QueryResult result = CharacterDatabase.PQuery("SELECT `GUID`, `Difficulty`, `GroupSize` FROM `custom_solocraft_character_stats` WHERE GUID = %u", itr->guid.GetCounter());
559+
QueryResult result = CharacterDatabase.Query("SELECT `GUID`, `Difficulty`, `GroupSize` FROM `custom_solocraft_character_stats` WHERE GUID = {}", itr->guid.GetCounter());
560560
if (result)
561561
{
562562
//Test for debuffs already give to other members - They cannot be used to determine the total offset because negative numbers will skew the total difficulty offset
563-
if ((*result)[1].GetFloat() > 0)
563+
if ((*result)[1].Get<float>() > 0)
564564
{
565-
GroupDifficulty = GroupDifficulty + (*result)[1].GetFloat();
565+
GroupDifficulty = GroupDifficulty + (*result)[1].Get<float>();
566566
//sLog->outError("%u : Group member GUID in instance: %u", player->GetGUID(), itr->guid);
567567
}
568568
}
@@ -576,12 +576,12 @@ class solocraft_player_instance_handler : public PlayerScript {
576576
{
577577

578578
//Database query to get offset from the last instance player exited
579-
QueryResult result = CharacterDatabase.PQuery("SELECT `GUID`, `Difficulty`, `GroupSize`, `SpellPower`, `Stats` FROM `custom_solocraft_character_stats` WHERE GUID = %u", player->GetGUID().GetCounter());
579+
QueryResult result = CharacterDatabase.Query("SELECT `GUID`, `Difficulty`, `GroupSize`, `SpellPower`, `Stats` FROM `custom_solocraft_character_stats` WHERE GUID = {}", player->GetGUID().GetCounter());
580580
if (result)
581581
{
582-
float difficulty = (*result)[1].GetFloat();
583-
int SpellPowerBonus = (*result)[3].GetUInt32();
584-
float StatsMultPct = (*result)[4].GetFloat();
582+
float difficulty = (*result)[1].Get<float>();
583+
int SpellPowerBonus = (*result)[3].Get<uint32>();
584+
float StatsMultPct = (*result)[4].Get<float>();
585585

586586
//sLog->outError("Map difficulty: %f", difficulty);
587587

@@ -603,7 +603,7 @@ class solocraft_player_instance_handler : public PlayerScript {
603603
}
604604

605605
//Remove database entry as the player is no longer in an instance
606-
CharacterDatabase.PExecute("DELETE FROM custom_solocraft_character_stats WHERE GUID = %u", player->GetGUID().GetCounter());
606+
CharacterDatabase.Execute("DELETE FROM custom_solocraft_character_stats WHERE GUID = {}", player->GetGUID().GetCounter());
607607
}
608608
}
609609
};

0 commit comments

Comments
 (0)