mirror of
https://github.com/TrinityCore/TrinityCore.git
synced 2026-01-16 07:30:42 +01:00
Core/DBLayer: Correct a type in HandleUnFreezeCommand (lowguid)
This commit is contained in:
@@ -4593,40 +4593,38 @@ bool ChatHandler::HandleUnFreezeCommand(const char *args)
|
||||
{
|
||||
std::string name;
|
||||
Player* player;
|
||||
char *TargetName = strtok((char*)args, " "); //get entered name
|
||||
if (!TargetName) //if no name entered use target
|
||||
{
|
||||
player = getSelectedPlayer();
|
||||
if (player) //prevent crash with creature as target
|
||||
name = player->GetName();
|
||||
}
|
||||
char* targetName = strtok((char*)args, " "); // Get entered name
|
||||
|
||||
else // if name entered
|
||||
if (targetName)
|
||||
{
|
||||
name = TargetName;
|
||||
name = targetName;
|
||||
normalizePlayerName(name);
|
||||
player = sObjectAccessor->FindPlayerByName(name.c_str());
|
||||
}
|
||||
else // If no name was entered - use target
|
||||
{
|
||||
player = getSelectedPlayer();
|
||||
if (player)
|
||||
name = player->GetName();
|
||||
}
|
||||
|
||||
//effect
|
||||
if (player)
|
||||
{
|
||||
PSendSysMessage(LANG_COMMAND_UNFREEZE, name.c_str());
|
||||
|
||||
//Reset player faction + allow combat + allow duels
|
||||
// Reset player faction + allow combat + allow duels
|
||||
player->setFactionForRace(player->getRace());
|
||||
player->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE);
|
||||
|
||||
//allow movement and spells
|
||||
// Remove Freeze spell (allowing movement and spells)
|
||||
player->RemoveAurasDueToSpell(9454);
|
||||
|
||||
//save player
|
||||
// Save player
|
||||
player->SaveToDB();
|
||||
}
|
||||
|
||||
if (!player)
|
||||
else
|
||||
{
|
||||
if (TargetName)
|
||||
if (targetName)
|
||||
{
|
||||
// Check for offline players
|
||||
PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_SEL_CHAR_GUID_BY_NAME);
|
||||
@@ -4638,12 +4636,13 @@ bool ChatHandler::HandleUnFreezeCommand(const char *args)
|
||||
SendSysMessage(LANG_COMMAND_FREEZE_WRONG);
|
||||
return true;
|
||||
}
|
||||
//if player found: delete his freeze aura
|
||||
Field* fields=result->Fetch();
|
||||
uint64 pguid = fields[0].GetUInt64();
|
||||
|
||||
// If player found: delete his freeze aura
|
||||
Field* fields = result->Fetch();
|
||||
uint32 lowGuid = fields[0].GetUInt32();
|
||||
|
||||
stmt = CharacterDatabase.GetPreparedStatement(CHAR_DEL_CHAR_AURA_FROZEN);
|
||||
stmt->setUInt32(0, pguid);
|
||||
stmt->setUInt32(0, lowGuid);
|
||||
CharacterDatabase.Execute(stmt);
|
||||
|
||||
PSendSysMessage(LANG_COMMAND_UNFREEZE, name.c_str());
|
||||
|
||||
Reference in New Issue
Block a user