Browse Source

Clean up CreatePlrItems

pull/256/head
qndel 7 years ago committed by Anders Jenbo
parent
commit
d4ae8e5606
  1. 15
      Source/items.cpp

15
Source/items.cpp

@ -856,8 +856,9 @@ void CreatePlrItems(int p)
int i; int i;
ItemStruct *pi = plr[p].InvBody; ItemStruct *pi = plr[p].InvBody;
for (i = 0; i < NUM_INVLOC; i++) { for (i = NUM_INVLOC; i != 0; i--) {
pi[i]._itype = ITYPE_NONE; pi->_itype = ITYPE_NONE;
pi++;
} }
// converting this to a for loop creates a `rep stosd` instruction, // converting this to a for loop creates a `rep stosd` instruction,
@ -865,15 +866,17 @@ void CreatePlrItems(int p)
memset(&plr[p].InvGrid, 0, sizeof(plr[p].InvGrid)); memset(&plr[p].InvGrid, 0, sizeof(plr[p].InvGrid));
pi = plr[p].InvList; pi = plr[p].InvList;
for (i = 0; i < NUM_INV_GRID_ELEM; i++) { for (i = NUM_INV_GRID_ELEM; i != 0; i--) {
pi[i]._itype = ITYPE_NONE; pi->_itype = ITYPE_NONE;
pi++;
} }
plr[p]._pNumInv = 0; plr[p]._pNumInv = 0;
pi = plr[p].SpdList; pi = plr[p].SpdList;
for (i = 0; i < MAXBELTITEMS; i++) { for (i = MAXBELTITEMS; i != 0; i--) {
pi[i]._itype = ITYPE_NONE; pi->_itype = ITYPE_NONE;
pi++;
} }
switch (plr[p]._pClass) { switch (plr[p]._pClass) {

Loading…
Cancel
Save