- Mesaj
- 106
- Çözümler
- 2
- Beğeni
- 89
- Puan
- 699
- Ticaret Puanı
- 0
Yapalı baya oldu o yüzden %100 case'i hatırlamıyorum ama event devam ederken iptal etmeye çalışıldığı için core crash yaşanıyordu, windows geliştirme ortamında yaşamıştım yanlış hatırlamıyorsam freebsd'de sorun olmayabilir:
new_switchbot.h
Arat:
Altına Ekle:
new_switchbot.cpp
Arat:
Altına Ekle:
Arat:
Altına Ekle:
Arat:
Altına Ekle:
Arat:
İf bloğunu değiştir:
Arat:
if bloğunu değiştir:
new_switchbot.h
Arat:
C++:
void Pause();
Altına Ekle:
C++:
void ClearEvent(); // Clear event pointer (called from event handler)
new_switchbot.cpp
Arat:
C++:
info->pkSwitchbot->SwitchItems();
Altına Ekle:
C++:
if (!info->pkSwitchbot->HasActiveSlots())
{
info->pkSwitchbot->ClearEvent(); // Clear event pointer
return 0; // Stop event
}
Arat:
C++:
void CSwitchbot::Pause()
{
if (m_pkSwitchEvent)
{
event_cancel(&m_pkSwitchEvent);
m_pkSwitchEvent = nullptr;
}
}
Altına Ekle:
C++:
void CSwitchbot::ClearEvent()
{
m_pkSwitchEvent = nullptr;
}
Arat:
C++:
info->pkSwitchbot->SwitchItems();
Altına Ekle:
C++:
if (!info->pkSwitchbot->HasActiveSlots())
{
info->pkSwitchbot->ClearEvent(); // Clear event pointer
return 0; // Stop event
}
Arat:
C++:
if (!HasActiveSlots())
{
İf bloğunu değiştir:
C++:
memset(&m_table.active, 0, sizeof(m_table.active));
CSwitchbotManager::Instance().SendSwitchbotUpdate(m_table.player_id);
return; // Exit early - event will stop when it returns 0
Arat:
C++:
if (stop)
if bloğunu değiştir:
C++:
if (stop)
{
// Don't call Stop() here - we're inside the event handler
// Just clear active flags and notify player
memset(&m_table.active, 0, sizeof(m_table.active));
if (SWITCHBOT_PRICE_TYPE == 1)
pkOwner->ChatPacket(CHAT_TYPE_INFO, LC_TEXT("Switchbot stopped. Out of switchers."));
else
pkOwner->ChatPacket(CHAT_TYPE_INFO, LC_TEXT("Switchbot stopped. Not enough money."));
CSwitchbotManager::Instance().SendSwitchbotUpdate(m_table.player_id);
return;
}