forked from mirror/openmw-tes3mp
[Server] Set sendToLoaded function as constant
Add assertions for CellController singleton
This commit is contained in:
parent
e3f4c63ea6
commit
b33e604a61
2 changed files with 7 additions and 5 deletions
|
@ -32,16 +32,16 @@ void Cell::removePlayer(Player *player)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
Cell::TPlayers Cell::getPlayers()
|
Cell::TPlayers Cell::getPlayers() const
|
||||||
{
|
{
|
||||||
return players;
|
return players;
|
||||||
}
|
}
|
||||||
|
|
||||||
void Cell::sendToLoaded(mwmp::WorldPacket *worldPacket, mwmp::BaseEvent *baseEvent)
|
void Cell::sendToLoaded(mwmp::WorldPacket *worldPacket, mwmp::BaseEvent *baseEvent) const
|
||||||
{
|
{
|
||||||
std::list <Player*> plList;
|
std::list <Player*> plList;
|
||||||
|
|
||||||
for (auto pl :getPlayers())
|
for (auto pl : players)
|
||||||
plList.push_back(pl);
|
plList.push_back(pl);
|
||||||
|
|
||||||
plList.sort();
|
plList.sort();
|
||||||
|
@ -73,6 +73,7 @@ CellController *CellController::sThis = nullptr;
|
||||||
|
|
||||||
void CellController::create()
|
void CellController::create()
|
||||||
{
|
{
|
||||||
|
assert(!sThis);
|
||||||
sThis = new CellController;
|
sThis = new CellController;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -85,6 +86,7 @@ void CellController::destroy()
|
||||||
|
|
||||||
CellController *CellController::get()
|
CellController *CellController::get()
|
||||||
{
|
{
|
||||||
|
assert(sThis);
|
||||||
return sThis;
|
return sThis;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -61,8 +61,8 @@ public:
|
||||||
void addPlayer(Player *player);
|
void addPlayer(Player *player);
|
||||||
void removePlayer(Player *player);
|
void removePlayer(Player *player);
|
||||||
|
|
||||||
TPlayers getPlayers();
|
TPlayers getPlayers() const;
|
||||||
void sendToLoaded(mwmp::WorldPacket *worldPacket, mwmp::BaseEvent *baseEvent);
|
void sendToLoaded(mwmp::WorldPacket *worldPacket, mwmp::BaseEvent *baseEvent) const;
|
||||||
|
|
||||||
std::string getDescription() const;
|
std::string getDescription() const;
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue