[Server] Add isMarkedForDeleteion function

This commit is contained in:
Koncord 2017-12-08 20:37:22 +08:00
parent 91398c5dcc
commit 392e645fe5
2 changed files with 11 additions and 1 deletions

View file

@ -91,7 +91,8 @@ void Player::Init(LuaState &lua)
"cellStateSize", &Player::cellStateSize, "cellStateSize", &Player::cellStateSize,
"addCellExplored", &Player::addCellExplored, "addCellExplored", &Player::addCellExplored,
"setAuthority", &Player::setAuthority, "setAuthority", &Player::setAuthority,
"customData", &Player::customData "customData", &Player::customData,
"markedForDeletion", sol::property(&Player::isMarkedForDeleteion)
); );
lua.getState()->new_enum("ChannelAction", lua.getState()->new_enum("ChannelAction",
@ -116,6 +117,7 @@ Player::Player(RakNet::RakNetGUID guid) : BasePlayer(guid), NetActor(), changedM
npcStats.blank(); npcStats.blank();
creatureStats.blank(); creatureStats.blank();
charClass.blank(); charClass.blank();
markedForDeletion = false;
customData = mwmp::Networking::get().getState().getState()->create_table(); customData = mwmp::Networking::get().getState().getState()->create_table();
} }
@ -807,3 +809,8 @@ void Player::setAuthority()
serverCell->sendToLoaded(authorityPacket, &writeActorList); serverCell->sendToLoaded(authorityPacket, &writeActorList);
} }
} }
bool Player::isMarkedForDeleteion() const
{
return markedForDeletion;
}

View file

@ -186,6 +186,8 @@ public:
void setAuthority(); void setAuthority();
bool isMarkedForDeleteion() const;
private: private:
CellController::TContainer cells; CellController::TContainer cells;
int handshakeCounter; int handshakeCounter;
@ -200,6 +202,7 @@ private:
Quests quests; Quests quests;
Spells spells; Spells spells;
sol::table customData; sol::table customData;
bool markedForDeletion;
}; };
#endif //OPENMW_PLAYER_HPP #endif //OPENMW_PLAYER_HPP