diff options
Diffstat (limited to 'src/game/Level3.cpp')
-rw-r--r-- | src/game/Level3.cpp | 26 |
1 files changed, 26 insertions, 0 deletions
diff --git a/src/game/Level3.cpp b/src/game/Level3.cpp index 47a3cc1a59b..4ab83c9fd3f 100644 --- a/src/game/Level3.cpp +++ b/src/game/Level3.cpp @@ -6544,3 +6544,29 @@ bool ChatHandler::HandleGroupRemoveCommand(const char* args) return true; } + +bool ChatHandler::HandlePossessCommand(const char* args) +{ + Unit* pUnit = getSelectedUnit(); + if(!pUnit) + return false; + + // Don't allow unlimited possession of players + if (pUnit->GetTypeId() == TYPEID_PLAYER) + return false; + + m_session->GetPlayer()->Possess(pUnit); + + return true; +} + +bool ChatHandler::HandleUnPossessCommand(const char* args) +{ + // Use this command to also unpossess ourselves + if (m_session->GetPlayer()->isPossessed()) + m_session->GetPlayer()->UnpossessSelf(false); + else + m_session->GetPlayer()->RemovePossess(false); + + return true; +} |