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

Method fireRemoveEntity

source/entities/Creature.cpp:2566–2588  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

2564}
2565
2566void Creature::fireRemoveEntity(Seat* seat)
2567{
2568 // If we are carrying an entity, we release it first, then we can remove it and us
2569 if(mCarriedEntity != nullptr)
2570 {
2571 ServerNotification* serverNotification = new ServerNotification(
2572 ServerNotificationType::releaseCarriedEntity, seat->getPlayer());
2573 serverNotification->mPacket << getName() << mCarriedEntity->getObjectType();
2574 serverNotification->mPacket << mCarriedEntity->getName();
2575 serverNotification->mPacket << mPosition;
2576 ODServer::getSingleton().queueServerNotification(serverNotification);
2577
2578 mCarriedEntity->removeSeatWithVision(seat);
2579 }
2580
2581 const std::string& name = getName();
2582 ServerNotification *serverNotification = new ServerNotification(
2583 ServerNotificationType::removeEntity, seat->getPlayer());
2584 GameEntityType type = getObjectType();
2585 serverNotification->mPacket << type;
2586 serverNotification->mPacket << name;
2587 ODServer::getSingleton().queueServerNotification(serverNotification);
2588}
2589
2590void Creature::fireCreatureRefreshIfNeeded()
2591{

Callers

nothing calls this directly

Calls 4

removeSeatWithVisionMethod · 0.80
getPlayerMethod · 0.45
getObjectTypeMethod · 0.45

Tested by

no test coverage detected