MWMechanics::Actor* player = ...; // get a pointer to the player object mwworld::Ptr playerCell = player->getCell();
std::string cellName = "Balmora, Temple"; mwworld::Ptr cell = MWMechanics::getPlayer().getCellRef(cellName);This code specifies the name of a cell (in this case, the Balmora Temple) and calls the getCellRef method of the current player object to retrieve a reference to that cell. The resulting cell reference is stored in the cell variable. Library: OpenMW (an open source engine for the game Morrowind)