- Mesaj
- 2.852
- Çözümler
- 297
- Beğeni
- 2.134
- Puan
- 1.850
- Ticaret Puanı
- 2
Böyle bir warning alıyorum bu warningi nasıl çözebilirim ?
Warning veren kod blogu
C++:
#ifdef ENABLE_CHEQUE_SYSTEM
void CHARACTER::ShopSearchInfo(bool bNameOnly, BYTE bJob, BYTE bItemType, BYTE bItemSubType, BYTE bMinLevel, BYTE bMaxLevel, BYTE bMinRefine, BYTE bMaxRefine, long lMinGold, long lMaxGold, BYTE bMinCheque, BYTE bMaxCheque, const char* c_szItemName)
#else
void CHARACTER::ShopSearchInfo(bool bNameOnly, BYTE bJob, BYTE bItemType, BYTE bItemSubType, BYTE bMinLevel, BYTE bMaxLevel, BYTE bMinRefine, BYTE bMaxRefine, long lMinGold, long lMaxGold, const char* c_szItemName)
#endif
{
if (!IsPC() || IsDead())
return;
if (IsOpenSafebox() || GetShop() || IsCubeOpen() || IsDead() || GetExchange() || GetOfflineShop() || GetMyShop())
{
ChatPacket(CHAT_TYPE_INFO, LC_TEXT("Acik olan pecereleri kapatmalisin."));
return;
}
if (quest::CQuestManager::instance().GetEventFlag("disable_shop_search"))
{
ChatPacket(CHAT_TYPE_INFO, LC_TEXT("Item arama penceresi suanda devre disi."));
return;
}
/*
if (!FindSpecifyItem(60004) && !FindSpecifyItem(60005))
{
ChatPacket(CHAT_TYPE_INFO, LC_TEXT("Ticaret camina sahip olmadan arama yapamazsin."));
return;
}
*/
if (bJob < JOB_WARRIOR || bJob > JOB_SHAMAN)
return;
if (bItemType < ITEM_NONE || bItemType > ITEM_BELT)
return;
if (bItemSubType < USE_POTION || bItemSubType > USE_PUT_INTO_RING_SOCKET)
return;
if (bMinLevel < 0 || bMinLevel > PLAYER_MAX_LEVEL_CONST)
return;
if (bMaxLevel < 0 || bMaxLevel > PLAYER_MAX_LEVEL_CONST)
return;
if (bMinRefine < 0 || bMinRefine > 9)
return;
if (bMaxRefine < 0 || bMaxRefine > 9)
return;
if (lMinGold < 0 || lMinGold > GOLD_MAX)
return;
if (lMaxGold < 0 || lMaxGold > GOLD_MAX)
return;
if (bMinCheque < 0 || bMinCheque > CHEQUE_MAX)
return;
if (bMaxCheque < 0 || bMaxCheque > CHEQUE_MAX)
return;
if (bMinLevel > bMaxLevel)
return;
if (bMinRefine > bMaxRefine)
return;
if (lMinGold > lMaxGold)
return;
if (bMinCheque > bMaxCheque)
return;
quest::PC* pPC = quest::CQuestManager::instance().GetPC(GetPlayerID());
if (!pPC)
return;
DWORD dwShopSearchSecCycle = 5;
DWORD dwNowSec = get_global_time();
DWORD dwLastShopSearchAttrSec = pPC->GetFlag("ShopSearch.LastShopSearchSecAttr");
if (dwLastShopSearchAttrSec + dwShopSearchSecCycle > dwNowSec)
{
ChatPacket(CHAT_TYPE_INFO, LC_TEXT("Tekrar arama yapabilmek icin %d sn. beklemelisin. Kalan sure %d sn."), (dwShopSearchSecCycle, dwShopSearchSecCycle - (dwNowSec - dwLastShopSearchAttrSec)));
return;
}
pPC->SetFlag("ShopSearch.LastShopSearchSecAttr", dwNowSec);
LPSECTREE_MAP pMap = SECTREE_MANAGER::instance().GetMap(GetMapIndex());
if (!pMap)
return;
FFindShopSearch f(this);
pMap->for_each(f);
if (f.m_mapPcShop.empty())
return;
std::vector<COfflineShop::OFFLINE_SHOP_ITEM> sendItems;
for (std::map<DWORD, LPCHARACTER>::iterator iter = f.m_mapPcShop.begin(); iter != f.m_mapPcShop.end(); ++iter)
{
LPCHARACTER tch = iter->second;
if (!tch)
continue;
if (!tch->IsOfflineShopNPC() || !tch->GetOfflineShop())
continue;
std::vector<COfflineShop::OFFLINE_SHOP_ITEM> offlineShopItem = tch->GetOfflineShop()->GetItemVector();
for (std::vector<COfflineShop::OFFLINE_SHOP_ITEM>::iterator iter2 = offlineShopItem.begin(); iter2 != offlineShopItem.end(); ++iter2)
{
if (iter2->bIsSold)
continue;
if (bNameOnly)
{
std::string strItemName(c_szItemName);
if (strItemName.length() > 2)
{
if (!((iter2->bItemLevel >= bMinLevel && iter2->bItemLevel <= bMaxLevel) || iter2->bItemLevel == 0))
continue;
if (!(iter2->price >= lMinGold && iter2->price <= lMaxGold))
continue;
#ifdef ENABLE_CHEQUE_SYSTEM
if (!(iter2->cheque >= bMinCheque && iter2->cheque <= bMaxCheque))
continue;
#endif
bool pushback = false;
std::string foundName(iter2->szItemName);
if (foundName.find(strItemName) != std::string::npos)
pushback = true;
if (pushback)
{
iter2->dwShopVID = iter->first;
strncpy(iter2->szOwnerName, tch->GetName(), CHARACTER_NAME_MAX_LEN);
sendItems.push_back(*iter2);
}
}
}
else
{
if (iter2->bItemType == bItemType && iter2->bItemSubType == bItemSubType)
{
if ((iter2->bItemType == ITEM_WEAPON || iter2->bItemType == ITEM_ARMOR) && !(iter2->bItemRefine >= bMinRefine && iter2->bItemRefine <= bMaxRefine))
continue;
if (!((iter2->bItemLevel >= bMinLevel && iter2->bItemLevel <= bMaxLevel) || iter2->bItemLevel == 0))
continue;
if (!(iter2->price >= lMinGold && iter2->price <= lMaxGold))
continue;
#ifdef ENABLE_CHEQUE_SYSTEM
if (!(iter2->cheque >= bMinCheque && iter2->cheque <= bMaxCheque))
continue;
#endif
bool cont = false;
switch (bJob)
{
case JOB_WARRIOR:
if (iter2->dwAntiFlag & ITEM_ANTIFLAG_WARRIOR)
cont = true;
break;
case JOB_ASSASSIN:
if (iter2->dwAntiFlag & ITEM_ANTIFLAG_ASSASSIN)
cont = true;
break;
case JOB_SHAMAN:
if (iter2->dwAntiFlag & ITEM_ANTIFLAG_SHAMAN)
cont = true;
break;
case JOB_SURA:
if (iter2->dwAntiFlag & ITEM_ANTIFLAG_SURA)
cont = true;
break;
}
if (cont)
continue;
iter2->dwShopVID = iter->first;
strncpy(iter2->szOwnerName, tch->GetName(), CHARACTER_NAME_MAX_LEN);
sendItems.push_back(*iter2);
}
}
}
}
std::stable_sort(sendItems.begin(), sendItems.end(), CompareItemVnumAcPriceAC);
for (std::vector<COfflineShop::OFFLINE_SHOP_ITEM>::iterator iter = sendItems.begin(); iter != sendItems.end(); ++iter)
{
if (!IsPC() || !iter->dwShopVID)
continue;
TPacketGCShopSearchItemInfo pack;
pack.bHeader = HEADER_GC_PSHOP_SEARCH_ITEM_INFO;
pack.dwVID = iter->dwShopVID;
strlcpy(pack.szOwnerName, iter->szOwnerName, CHARACTER_NAME_MAX_LEN);
pack.bPos = iter->pos;
pack.dwGold = iter->price;
#ifdef ENABLE_CHEQUE_SYSTEM
pack.bCheque = iter->cheque;
#endif
pack.dwVnum = iter->vnum;
pack.bCount = static_cast<BYTE>(iter->count);
pack.dwFlags = iter->dwFlag;
pack.dwAntiFlags = iter->dwAntiFlag;
thecore_memcpy(pack.alSockets, iter->alSockets, sizeof(pack.alSockets));
thecore_memcpy(pack.aAttr, iter->aAttr, sizeof(pack.aAttr));
GetDesc()->LargePacket(&pack, sizeof(TPacketGCShopSearchItemInfo));
}
}
Sistem Linki :
Linkleri görebilmek için
giriş yap veya kayıt ol.
Son düzenleme: