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

Method fireTrapSound

source/traps/Trap.cpp:644–659  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

642}
643
644void Trap::fireTrapSound(Tile& tile, const std::string& soundFamily)
645{
646 std::string sound = "Traps/" + soundFamily;
647 for(Seat* seat : tile.getSeatsWithVision())
648 {
649 if(seat->getPlayer() == nullptr)
650 continue;
651 if(!seat->getPlayer()->getIsHuman())
652 continue;
653
654 ServerNotification *serverNotification = new ServerNotification(
655 ServerNotificationType::playSpatialSound, seat->getPlayer());
656 serverNotification->mPacket << sound << tile.getX() << tile.getY();
657 ODServer::getSingleton().queueServerNotification(serverNotification);
658 }
659}
660
661bool Trap::importTrapFromStream(Trap& trap, std::istream& is)
662{

Callers

nothing calls this directly

Calls 5

getIsHumanMethod · 0.80
getPlayerMethod · 0.45
getXMethod · 0.45
getYMethod · 0.45

Tested by

no test coverage detected