本文整理汇总了C++中BedItem::internalRemoveSleeper方法的典型用法代码示例。如果您正苦于以下问题:C++ BedItem::internalRemoveSleeper方法的具体用法?C++ BedItem::internalRemoveSleeper怎么用?C++ BedItem::internalRemoveSleeper使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类BedItem
的用法示例。
在下文中一共展示了BedItem::internalRemoveSleeper方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: wakeUp
void BedItem::wakeUp()
{
if(!house)
return;
if(sleeper)
{
if(Player* player = g_game.getPlayerByGuidEx(sleeper))
{
regeneratePlayer(player);
if(player->isVirtual())
{
IOLoginData::getInstance()->savePlayer(player);
delete player;
}
else
g_game.addCreatureHealth(player);
}
}
Beds::getInstance().setBedSleeper(NULL, sleeper);
internalRemoveSleeper();
BedItem* nextBedItem = getNextBedItem();
if(nextBedItem)
nextBedItem->internalRemoveSleeper();
updateAppearance(NULL);
if(nextBedItem)
nextBedItem->updateAppearance(NULL);
}
示例2: wakeUp
void BedItem::wakeUp(Player* player)
{
// avoid crashes
if (!house) {
return;
}
if (sleeperGUID != 0) {
if (!player) {
std::string name;
if (IOLoginData::getInstance()->getNameByGuid(sleeperGUID, name)) {
Player* _player = new Player(name, NULL);
if (IOLoginData::getInstance()->loadPlayer(_player, name)) {
regeneratePlayer(_player);
IOLoginData::getInstance()->savePlayer(_player);
}
delete _player;
_player = NULL;
}
} else {
regeneratePlayer(player);
g_game.addCreatureHealth(player);
}
}
// update the BedSleepersMap
Beds::getInstance().setBedSleeper(NULL, sleeperGUID);
BedItem* nextBedItem = getNextBedItem();
// unset sleep info
internalRemoveSleeper();
if (nextBedItem) {
nextBedItem->internalRemoveSleeper();
}
// change self and partner's appearance
updateAppearance(NULL);
if (nextBedItem) {
nextBedItem->updateAppearance(NULL);
}
}
示例3: wakeUp
void BedItem::wakeUp(Player* player)
{
// avoid crashes
if (!house) {
return;
}
if (sleeperGUID != 0) {
if (!player) {
Player _player(nullptr);
if (IOLoginData::loadPlayerById(&_player, sleeperGUID)) {
regeneratePlayer(&_player);
IOLoginData::savePlayer(&_player);
}
} else {
regeneratePlayer(player);
g_game.addCreatureHealth(player);
}
}
// update the BedSleepersMap
Beds::getInstance().setBedSleeper(nullptr, sleeperGUID);
BedItem* nextBedItem = getNextBedItem();
// unset sleep info
internalRemoveSleeper();
if (nextBedItem) {
nextBedItem->internalRemoveSleeper();
}
// change self and partner's appearance
updateAppearance(nullptr);
if (nextBedItem) {
nextBedItem->updateAppearance(nullptr);
}
}