Browse Source

Clean up InvGetItem

pull/88/head
Anders Jenbo 7 years ago
parent
commit
11d625cf5a
  1. 41
      Source/inv.cpp

41
Source/inv.cpp

@ -1743,42 +1743,33 @@ void CheckQuestItem(int pnum)
void InvGetItem(int pnum, int ii) void InvGetItem(int pnum, int ii)
{ {
int v2; // ebp int i;
int v3; // edx
int v4; // ecx
int v5; // ecx
int pnuma; // [esp+4h] [ebp-8h]
int v7; // [esp+8h] [ebp-4h]
v7 = ii;
pnuma = pnum;
if (dropGoldFlag) { if (dropGoldFlag) {
dropGoldFlag = FALSE; dropGoldFlag = FALSE;
dropGoldValue = 0; dropGoldValue = 0;
} }
v2 = ii;
if (dItem[item[ii]._ix][item[ii]._iy]) { if (dItem[item[ii]._ix][item[ii]._iy]) {
if (myplr == pnum && pcurs >= CURSOR_FIRSTITEM) if (myplr == pnum && pcurs >= CURSOR_FIRSTITEM)
NetSendCmdPItem(TRUE, CMD_SYNCPUTITEM, plr[myplr].WorldX, plr[myplr].WorldY); NetSendCmdPItem(TRUE, CMD_SYNCPUTITEM, plr[myplr].WorldX, plr[myplr].WorldY);
_HIBYTE(item[v2]._iCreateInfo) &= 0x7Fu; item[ii]._iCreateInfo &= ~0x8000;
qmemcpy(&plr[pnuma].HoldItem, &item[v2], sizeof(plr[pnuma].HoldItem)); plr[pnum].HoldItem = item[ii];
CheckQuestItem(pnuma); CheckQuestItem(pnum);
CheckBookLevel(pnuma); CheckBookLevel(pnum);
CheckItemStats(pnuma); CheckItemStats(pnum);
v3 = 0; dItem[item[ii]._ix][item[ii]._iy] = 0;
dItem[item[v2]._ix][item[v2]._iy] = 0; i = 0;
while (v3 < numitems) { while (i < numitems) {
v4 = itemactive[v3]; if (itemactive[i] == ii) {
if (v4 == v7) { DeleteItem(itemactive[i], i);
DeleteItem(v4, v3); i = 0;
v3 = 0;
} else { } else {
++v3; i++;
} }
} }
v5 = plr[pnuma].HoldItem._iCurs;
pcursitem = -1; pcursitem = -1;
SetCursor_(v5 + CURSOR_FIRSTITEM); SetCursor_(plr[pnum].HoldItem._iCurs + CURSOR_FIRSTITEM);
} }
} }
// 4B8CC0: using guessed type char pcursitem; // 4B8CC0: using guessed type char pcursitem;

Loading…
Cancel
Save