[DiscordArchive] what is the compile error?
[DiscordArchive] what is the compile error?
Archived author: Kitzunu • Posted: 2020-05-11T19:41:09.145000+00:00
Original source
```cpp
if (result)
{
do
{
bool has_items = false;
Field* fields = result->Fetch();
if (fields[14].GetUInt32() != prevMailID)
{
if (m)
m_mail.push_back(m);
m = new Mail;
m->messageID = fields[14].GetUInt32();
m->messageType = fields[15].GetUInt8();
m->sender = fields[16].GetUInt32();
m->receiver = fields[17].GetUInt32();
m->subject = fields[18].GetString();
m->body = fields[19].GetString();
has_items = fields[20].GetBool();
m->expire_time = time_t(fields[21].GetUInt32());
m->deliver_time = time_t(fields[22].GetUInt32());
m->money = fields[23].GetUInt32();
m->COD = fields[24].GetUInt32();
m->checked = fields[25].GetUInt8();
m->stationery = fields[26].GetUInt8();
m->mailTemplateId = fields[27].GetInt16();
if (m->mailTemplateId && !sMailTemplateStore.LookupEntry(m->mailTemplateId))
{
sLog->outError("Player::_LoadMail - Mail (%u) have not existed MailTemplateId (%u), remove at load", m->messageID, m->mailTemplateId);
m->mailTemplateId = 0;
}
m->state = MAIL_STATE_UNCHANGED;
}
if (m && fields[20].GetBool() /*has_items*/ && fields[12].GetUInt32() /*itemEntry*/)
```
well something of that is the cause
Archived author: Kitzunu • Posted: 2020-05-11T19:43:52.613000+00:00
Original source
Comparing that with TC, they don't use bool has_itmes = false;
Archived author: Kitzunu • Posted: 2020-05-11T19:44:04.537000+00:00
Original source
they just use the value from db
Archived author: MishaParem • Posted: 2020-05-11T19:44:52.367000+00:00
Original source
I checked the code, seems like we can remove lines 18963 and 18978
Archived author: MishaParem • Posted: 2020-05-11T19:44:59.993000+00:00
Original source
and it will work
Archived author: Kitzunu • Posted: 2020-05-11T19:45:22.194000+00:00
Original source
well, not 18978, just add bool before
Archived author: MishaParem • Posted: 2020-05-11T19:46:06.933000+00:00
Original source
well... the thing is, has_items isn't used in the context of that function
Archived author: MishaParem • Posted: 2020-05-11T19:46:18.267000+00:00
Original source
so the compiler would still throw the same error
Archived author: Kitzunu • Posted: 2020-05-11T19:46:21.843000+00:00
Original source
if (m && fields[20].GetBool() /*has_items*/ && fields[12].GetUInt32() /*itemEntry*/)
Archived author: Kitzunu • Posted: 2020-05-11T19:46:29.338000+00:00
Original source
or maybe I am wrong