[AZTH-MS] Fix crash at save to DB AZTH groups

This commit is contained in:
Winfidonarleyan
2019-08-27 02:58:10 +07:00
parent 0c0e39e84f
commit b425fb8292
2 changed files with 6 additions and 4 deletions

View File

@@ -1,9 +1,9 @@
#include "AzthGroupMgr.h"
#include "DatabaseEnv.h"
AzthGroupMgr::AzthGroupMgr(Group* group)
AzthGroupMgr::AzthGroupMgr(Group* original)
{
group = group;
group = original;
QueryResult result = CharacterDatabase.PQuery("SELECT `MaxlevelGroup`, `MaxGroupSize` FROM `azth_groups` WHERE `guid` = '%u'", group->GetLowGUID());
if (!result)
@@ -26,7 +26,9 @@ AzthGroupMgr::~AzthGroupMgr()
void AzthGroupMgr::saveToDb()
{
CharacterDatabase.PExecute("UPDATE azth_groups SET MaxLevelGroup = %u, MaxGroupSize = %u WHERE leaderGuid = %u", this->levelMaxGroup, this->groupSize, this->group->GetLeaderGUID());
ASSERT(group);
CharacterDatabase.PExecute("UPDATE azth_groups SET MaxLevelGroup = %u, MaxGroupSize = %u WHERE leaderGuid = %u", levelMaxGroup, groupSize, this->group->GetLeaderGUID());
}

View File

@@ -6,7 +6,7 @@
class AzthGroupMgr
{
public:
explicit AzthGroupMgr(Group* group);
explicit AzthGroupMgr(Group* original);
~AzthGroupMgr();
void saveToDb();