| 6547 | |
| 6548 | bool ChatHandler::HandlePossessCommand(const char* args) |
| 6549 | { |
| 6550 | Unit* pUnit = getSelectedUnit(); |
| 6551 | if(!pUnit) |
| 6552 | return false; |
| 6553 | |
| 6554 | // Don't allow unlimited possession of players |
| 6555 | if (pUnit->GetTypeId() == TYPEID_PLAYER) |
| 6556 | return false; |
| 6557 | |
| 6558 | m_session->GetPlayer()->Possess(pUnit); |
| 6559 | |
| 6560 | return true; |
| 6561 | } |
| 6562 | |
| 6563 | bool ChatHandler::HandleUnPossessCommand(const char* args) |
| 6564 | { |
| 6565 | // Use this command to also unpossess ourselves |
| 6566 | if (m_session->GetPlayer()->isPossessed()) |
| 6567 | m_session->GetPlayer()->UnpossessSelf(false); |
| 6568 | else |
| 6569 | m_session->GetPlayer()->RemovePossess(false); |
| 6570 | |
| 6571 | return true; |
| 6572 | } |