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

Method clearDestinations

source/entities/MovableGameEntity.cpp:113–134  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

111}
112
113void MovableGameEntity::clearDestinations(const std::string& animation, bool loopAnim, bool playIdleWhenAnimationEnds)
114{
115 mWalkQueue.clear();
116 stopWalking();
117
118 for(Seat* seat : mSeatsWithVisionNotified)
119 {
120 if(seat->getPlayer() == nullptr)
121 continue;
122 if(!seat->getPlayer()->getIsHuman())
123 continue;
124
125 const std::string& name = getName();
126 const std::string emptyString;
127 uint32_t nbDest = 0;
128 ServerNotification *serverNotification = new ServerNotification(
129 ServerNotificationType::animatedObjectSetWalkPath, seat->getPlayer());
130 serverNotification->mPacket << name << emptyString << animation
131 << loopAnim << playIdleWhenAnimationEnds << nbDest;
132 ODServer::getSingleton().queueServerNotification(serverNotification);
133 }
134}
135
136void MovableGameEntity::stopWalking()
137{

Calls 4

clearMethod · 0.80
getIsHumanMethod · 0.80
getPlayerMethod · 0.45

Tested by

no test coverage detected