MCPcopy Create free account
hub / github.com/OpenDungeons/OpenDungeons / fireCreatureRefreshIfNeeded

Method fireCreatureRefreshIfNeeded

source/entities/Creature.cpp:2590–2613  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

2588}
2589
2590void Creature::fireCreatureRefreshIfNeeded()
2591{
2592 if(!mNeedFireRefresh)
2593 return;
2594
2595 mNeedFireRefresh = false;
2596 for(Seat* seat : mSeatsWithVisionNotified)
2597 {
2598 if(seat->getPlayer() == nullptr)
2599 continue;
2600 if(!seat->getPlayer()->getIsHuman())
2601 continue;
2602
2603 const std::string& name = getName();
2604 ServerNotification *serverNotification = new ServerNotification(
2605 ServerNotificationType::entitiesRefresh, seat->getPlayer());
2606 uint32_t nbCreature = 1;
2607 serverNotification->mPacket << nbCreature;
2608 serverNotification->mPacket << GameEntityType::creature;
2609 serverNotification->mPacket << name;
2610 exportToPacketForUpdate(serverNotification->mPacket, seat);
2611 ODServer::getSingleton().queueServerNotification(serverNotification);
2612 }
2613}
2614
2615void Creature::fireChatMsgTookFee(int goldTaken)
2616{

Callers 1

fireRefreshEntitiesMethod · 0.80

Calls 3

getIsHumanMethod · 0.80
getPlayerMethod · 0.45

Tested by

no test coverage detected