game: fix post-restart mall open flow
Some checks failed
build / Linux asan (push) Has been cancelled
build / Linux release (push) Has been cancelled
build / FreeBSD build (push) Has been cancelled

This commit is contained in:
server
2026-04-14 14:27:15 +02:00
parent bc1175eb35
commit cf6deb1895
3 changed files with 17 additions and 13 deletions

View File

@@ -5698,8 +5698,9 @@ void CHARACTER::ReqSafeboxLoad(const char* pszPassword)
}
int iPulse = thecore_pulse();
const int last_safebox_load_time = GetSafeboxLoadTime();
if (iPulse - GetSafeboxLoadTime() < PASSES_PER_SEC(10))
if (last_safebox_load_time > 0 && iPulse - last_safebox_load_time < PASSES_PER_SEC(10))
{
ChatPacket(CHAT_TYPE_INFO, LC_TEXT("<창고> 창고를 닫은지 10초 안에는 열 수 없습니다."));
return;

View File

@@ -938,6 +938,7 @@ ACMD(do_mall_password)
}
int iPulse = thecore_pulse();
const int last_mall_load_time = ch->GetMallLoadTime();
if (ch->GetMall())
{
@@ -945,7 +946,7 @@ ACMD(do_mall_password)
return;
}
if (iPulse - ch->GetMallLoadTime() < passes_per_sec * 10) // 10초에 한번만 요청 가능
if (last_mall_load_time > 0 && iPulse - last_mall_load_time < passes_per_sec * 10) // 10초에 한번만 요청 가능
{
ch->ChatPacket(CHAT_TYPE_INFO, LC_TEXT("<창고> 창고를 닫은지 10초 안에는 열 수 없습니다."));
return;

View File

@@ -235,19 +235,17 @@ namespace quest
assert(m_RunningQuestState);
packet_quest_info qi;
TEMP_BUFFER payload;
qi.header = GC::QUEST_INFO;
qi.length = sizeof(struct packet_quest_info);
qi.index = m_RunningQuestState->iIndex;
qi.flag = m_iSendToClient;
TEMP_BUFFER buf;
buf.write(&qi, sizeof(qi));
if (m_iSendToClient & QUEST_SEND_ISBEGIN)
{
BYTE temp = m_RunningQuestState->bStart?1:0;
buf.write(&temp,1);
payload.write(&temp,1);
qi.length+=1;
sys_log(1, "QUEST BeginFlag %d", (int)temp);
@@ -255,7 +253,7 @@ namespace quest
if (m_iSendToClient & QUEST_SEND_TITLE)
{
m_RunningQuestState->_title.reserve(30+1);
buf.write(m_RunningQuestState->_title.c_str(), 30+1);
payload.write(m_RunningQuestState->_title.c_str(), 30+1);
qi.length+=30+1;
sys_log(1, "QUEST Title %s", m_RunningQuestState->_title.c_str());
@@ -263,14 +261,14 @@ namespace quest
if (m_iSendToClient & QUEST_SEND_CLOCK_NAME)
{
m_RunningQuestState->_clock_name.reserve(16+1);
buf.write(m_RunningQuestState->_clock_name.c_str(), 16+1);
payload.write(m_RunningQuestState->_clock_name.c_str(), 16+1);
qi.length+=16+1;
sys_log(1, "QUEST Clock Name %s", m_RunningQuestState->_clock_name.c_str());
}
if (m_iSendToClient & QUEST_SEND_CLOCK_VALUE)
{
buf.write(&m_RunningQuestState->_clock_value, sizeof(int));
payload.write(&m_RunningQuestState->_clock_value, sizeof(int));
qi.length+=4;
sys_log(1, "QUEST Clock Value %d", m_RunningQuestState->_clock_value);
@@ -278,14 +276,14 @@ namespace quest
if (m_iSendToClient & QUEST_SEND_COUNTER_NAME)
{
m_RunningQuestState->_counter_name.reserve(16+1);
buf.write(m_RunningQuestState->_counter_name.c_str(), 16+1);
payload.write(m_RunningQuestState->_counter_name.c_str(), 16+1);
qi.length+=16+1;
sys_log(1, "QUEST Counter Name %s", m_RunningQuestState->_counter_name.c_str());
}
if (m_iSendToClient & QUEST_SEND_COUNTER_VALUE)
{
buf.write(&m_RunningQuestState->_counter_value, sizeof(int));
payload.write(&m_RunningQuestState->_counter_value, sizeof(int));
qi.length+=4;
sys_log(1, "QUEST Counter Value %d", m_RunningQuestState->_counter_value);
@@ -293,12 +291,17 @@ namespace quest
if (m_iSendToClient & QUEST_SEND_ICON_FILE)
{
m_RunningQuestState->_icon_file.reserve(24+1);
buf.write(m_RunningQuestState->_icon_file.c_str(), 24+1);
payload.write(m_RunningQuestState->_icon_file.c_str(), 24+1);
qi.length+=24+1;
sys_log(1, "QUEST Icon File %s", m_RunningQuestState->_icon_file.c_str());
}
TEMP_BUFFER buf;
buf.write(&qi, sizeof(qi));
if (payload.size() > 0)
buf.write(payload.read_peek(), payload.size());
CQuestManager::instance().GetCurrentCharacterPtr()->GetDesc()->Packet(buf.read_peek(),buf.size());
m_iSendToClient = 0;
@@ -722,4 +725,3 @@ namespace quest
}
}
}