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

Method notifyCreatureCannotFindFood

source/game/Player.cpp:541–557  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

539}
540
541void Player::notifyCreatureCannotFindFood(Creature& creature)
542{
543 if(mCreatureCannotFindFood <= 0.0f)
544 {
545 mCreatureCannotFindFood = CREATURE_CANNOT_FIND_FOOD_TIME_COUNT;
546
547 std::string chatMsg = creature.getName() + " cannot find food";
548 ServerNotification *serverNotification = new ServerNotification(
549 ServerNotificationType::chatServer, this);
550 serverNotification->mPacket << chatMsg << EventShortNoticeType::genericGameInfo;
551 ODServer::getSingleton().queueServerNotification(serverNotification);
552
553 std::vector<Seat*> seats;
554 seats.push_back(getSeat());
555 mGameMap->fireRelativeSound(seats, SoundRelativeKeeperStatements::CreatureNoFood);
556 }
557}
558
559void Player::fireEvents()
560{

Callers 1

handleSearchFoodMethod · 0.80

Calls 2

fireRelativeSoundMethod · 0.80

Tested by

no test coverage detected