Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- void ProtocolGame::GetTileDescription(const Tile* tile, NetworkMessage_ptr msg)
- {
- if(tile){
- int count = 0;
- if(tile->ground){
- msg->AddItem(tile->ground);
- count++;
- }
- const TileItemVector* items = tile->getItemList();
- const CreatureVector* creatures = tile->getCreatures();
- ItemVector::const_iterator it;
- if(items){
- for(it = items->getBeginTopItem(); ((it != items->getEndTopItem()) && (count < 10)); ++it){
- msg->AddItem(*it);
- count++;
- }
- }
- if(creatures){
- CreatureVector::const_iterator cit;
- for(cit = creatures->begin(); ((cit != creatures->end()) && (count < 10)); ++cit){
- if(player->canSeeCreature(*cit)){
- bool known;
- uint32_t removedKnown;
- checkCreatureAsKnown((*cit)->getID(), known, removedKnown);
- AddCreature(msg, *cit, known, removedKnown);
- count++;
- }
- }
- }
- if(items){
- for(it = items->getBeginDownItem(); ((it != items->getEndDownItem()) && (count < 10)); ++it){
- msg->AddItem(*it);
- count++;
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement