Fix MSVC compilation by not using non-standard struct initialization (#20)

Co-authored-by: Raymonf <Raymonf@users.noreply.github.com>
This commit is contained in:
Raymonf 2020-08-21 14:17:06 -04:00 committed by GitHub
parent 7a46f061ed
commit 88d08ffca7
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -190,7 +190,8 @@ void PlayerManager::enterPlayer(CNSocket* sock, CNPacketData* data) {
response->PCLoadData2CL.aEquip[i] = plr.Equip[i];
// protocol-agnostic sItemBase usage
sItemBase item = (sItemBase){0};
sItemBase item;
memset(&item, 0, sizeof(sItemBase));
item.iID = 495;
for (int i = 0; i < AINVEN_COUNT; i++) {
@ -200,7 +201,7 @@ void PlayerManager::enterPlayer(CNSocket* sock, CNPacketData* data) {
plr.Inven[i] = item;
break;
default:
plr.Inven[i] = (sItemBase){0};
memset(&plr.Inven[i], 0, sizeof(sItemBase));
}
response->PCLoadData2CL.aInven[i] = plr.Inven[i];
}