| 2529 | } |
| 2530 | |
| 2531 | void Creature::fireAddEntity(Seat* seat, bool async) |
| 2532 | { |
| 2533 | if(async) |
| 2534 | { |
| 2535 | ServerNotification serverNotification( |
| 2536 | ServerNotificationType::addEntity, seat->getPlayer()); |
| 2537 | exportHeadersToPacket(serverNotification.mPacket); |
| 2538 | exportToPacket(serverNotification.mPacket, seat); |
| 2539 | ODServer::getSingleton().sendAsyncMsg(serverNotification); |
| 2540 | |
| 2541 | if(mCarriedEntity != nullptr) |
| 2542 | { |
| 2543 | OD_LOG_ERR("Trying to fire add creature in async mode name=" + getName() + " while carrying " + mCarriedEntity->getName()); |
| 2544 | } |
| 2545 | return; |
| 2546 | } |
| 2547 | |
| 2548 | ServerNotification* serverNotification = new ServerNotification( |
| 2549 | ServerNotificationType::addEntity, seat->getPlayer()); |
| 2550 | exportHeadersToPacket(serverNotification->mPacket); |
| 2551 | exportToPacket(serverNotification->mPacket, seat); |
| 2552 | ODServer::getSingleton().queueServerNotification(serverNotification); |
| 2553 | |
| 2554 | if(mCarriedEntity != nullptr) |
| 2555 | { |
| 2556 | mCarriedEntity->addSeatWithVision(seat, false); |
| 2557 | |
| 2558 | serverNotification = new ServerNotification( |
| 2559 | ServerNotificationType::carryEntity, seat->getPlayer()); |
| 2560 | serverNotification->mPacket << getName() << mCarriedEntity->getObjectType(); |
| 2561 | serverNotification->mPacket << mCarriedEntity->getName(); |
| 2562 | ODServer::getSingleton().queueServerNotification(serverNotification); |
| 2563 | } |
| 2564 | } |
| 2565 | |
| 2566 | void Creature::fireRemoveEntity(Seat* seat) |
| 2567 | { |
nothing calls this directly
no test coverage detected