Ayyıldız2 | 2008 TR Yapısı • 1-99 Orta Emek Destan • Oto Avsız • 10 Temmuz 21:00 HEMEN TIKLA!
RemoveAttributeType fonksiyonu içinde yine kendisini çağırıyor o yüzden sonsuz bir döngüye neden oluyor kodlama hatasını düzeltmiş adam .anlamadım
RemoveAttributeType nin RemoveAttributeAt olması neyi farkediyor acaba bilgilendirip aydınlatabilir misiniz ?
@MT2Dev paylaşım için teşekkürler.
Ben çok eskiden böyle düzenlemiştim
Kod:
bool CItem::RemoveAttributeType(BYTE bType)
{
if (bType < 0 || bType > MAX_ATTRIBUTE_TYPE) // MAX_ATTRIBUTE_TYPE, türün üst sınırını temsil eder
{
sys_log(0, "Invalid attribute type: %d", bType);
return false; // Geçersiz tür, işlemi iptal et
}
int index = FindAttribute(bType);
if (index == -1)
{
sys_log(0, "Attribute type %d not found", bType);
return false; // Attribute mevcut değil, işlem yapılmaz
}
if (!RemoveAttributeAt(index))
{
sys_log(0, "Failed to remove attribute type %d at index %d", bType, index);
return false; // Silme işlemi başarısız olduysa, hata mesajı yazdır
}
sys_log(0, "Successfully removed attribute type %d", bType);
return true;
}
Şu an konuyu görüntüleyenler (Toplam : 0, Üye: 0, Misafir: 0)
Benzer konular
- Cevaplar
- 65
- Görüntüleme
- 12K
- Cevaplar
- 13
- Görüntüleme
- 2K