Skip to content

Commit

Permalink
Use int8_t and move Item::isEmpty() checks
Browse files Browse the repository at this point in the history
  • Loading branch information
StephenCWills committed Aug 1, 2023
1 parent c0752ec commit c6573fc
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions Source/pack.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -556,9 +556,9 @@ bool UnPackNetPlayer(const PlayerNetPack &packed, Player &player)
for (int i = 0; i < NUM_INVLOC; i++) {
if (!UnPackNetItem(player, packed.InvBody[i], player.InvBody[i]))
return false;
auto loc = static_cast<int>(player.GetItemLocation(player.InvBody[i]));
if (player.InvBody[i].isEmpty())
continue;
auto loc = static_cast<int8_t>(player.GetItemLocation(player.InvBody[i]));
switch (i) {
case INVLOC_HEAD:
ValidateField(loc, loc == ILOC_HELM);
Expand Down Expand Up @@ -592,9 +592,9 @@ bool UnPackNetPlayer(const PlayerNetPack &packed, Player &player)
for (int i = 0; i < MaxBeltItems; i++) {
if (!UnPackNetItem(player, packed.SpdList[i], player.SpdList[i]))
return false;
auto loc = static_cast<int>(player.GetItemLocation(player.SpdList[i]));
if (player.SpdList[i].isEmpty())
continue;
auto loc = static_cast<int8_t>(player.GetItemLocation(player.SpdList[i]));
ValidateField(loc, loc == ILOC_BELT);
}

Expand Down

0 comments on commit c6573fc

Please sign in to comment.