mirror of
https://github.com/mod-playerbots/azerothcore-wotlk.git
synced 2026-01-16 02:20:27 +00:00
chore(Command/unstuck) use command with offline players (#18913)
Co-authored-by: Andrew <47818697+Nyeriah@users.noreply.github.com> Co-authored-by: Anton Popovichenko <walkline.ua@gmail.com>
This commit is contained in:
@@ -1386,7 +1386,26 @@ public:
|
||||
|
||||
if (!target || !target->IsConnected())
|
||||
{
|
||||
return false;
|
||||
if (handler->HasLowerSecurity(nullptr, target->GetGUID()))
|
||||
return false;
|
||||
|
||||
CharacterDatabasePreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_SEL_CHARACTER_HOMEBIND);
|
||||
stmt->SetData(0, target->GetGUID().GetCounter());
|
||||
|
||||
PreparedQueryResult result = CharacterDatabase.Query(stmt);
|
||||
|
||||
if (result)
|
||||
{
|
||||
Field* fieldsDB = result->Fetch();
|
||||
WorldLocation loc(fieldsDB[0].Get<uint16>(), fieldsDB[2].Get<float>(), fieldsDB[3].Get<float>(), fieldsDB[4].Get<float>(), 0.0f);
|
||||
uint32 zoneId = fieldsDB[1].Get<uint16>();
|
||||
|
||||
Player::SavePositionInDB(loc, zoneId, target->GetGUID(), nullptr);
|
||||
|
||||
handler->PSendSysMessage(LANG_SUMMONING, target->GetName(), handler->GetAcoreString(LANG_OFFLINE));
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
Player* player = target->GetConnectedPlayer();
|
||||
|
||||
Reference in New Issue
Block a user