Skip to content

Commit

Permalink
Only display expire date if it actually has expire date set
Browse files Browse the repository at this point in the history
  • Loading branch information
Nyeriah committed Dec 24, 2024
1 parent b5ca174 commit a093fcd
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion src/mod_chromiecraft_smartstone_scripts.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -166,8 +166,13 @@ class item_chromiecraft_smartstone : public ItemScript

for (auto const& pet : pets)
{
std::string expireMsg = "";

if (expireInfoMap[pet.CreatureId].tm_year != 1970)
expireMsg = Acore::StringFormat("\n(Expires: {:%Y-%m-%d %H:%M})", expireInfoMap[pet.CreatureId]);

if (sSmartstone->IsPetAvailable(player, pet, subscriptionLevel))
player->PlayerTalkClass->GetGossipMenu().AddMenuItem(pet.CreatureId, 0, pet.Description + Acore::StringFormat("\n(Expires: {:%Y-%m-%d %H:%M})", expireInfoMap[pet.CreatureId]), 0, pet.CreatureId, "", 0);
player->PlayerTalkClass->GetGossipMenu().AddMenuItem(pet.CreatureId, 0, pet.Description + expireMsg, 0, pet.CreatureId, "", 0);
}

player->PlayerTalkClass->SendGossipMenu(92003, item->GetGUID());
Expand Down

0 comments on commit a093fcd

Please sign in to comment.