| 651 | } |
| 652 | |
| 653 | void CheckInvPaste(int pnum, int mx, int my) |
| 654 | { |
| 655 | int r, sx, sy; |
| 656 | int i, j, xx, yy, ii; |
| 657 | BOOL done, done2h; |
| 658 | int il, cn, it, iv, ig, gt; |
| 659 | ItemStruct tempitem; |
| 660 | |
| 661 | SetICursor(plr[pnum].HoldItem._iCurs + CURSOR_FIRSTITEM); |
| 662 | i = mx + (icursW >> 1); |
| 663 | j = my + (icursH >> 1); |
| 664 | sx = icursW28; |
| 665 | sy = icursH28; |
| 666 | done = FALSE; |
| 667 | for (r = 0; r < sizeof(InvRect) / sizeof(InvRect[0]) && !done; r++) { |
| 668 | if (i >= InvRect[r].X && i < InvRect[r].X + INV_SLOT_SIZE_PX) { |
| 669 | if (j >= InvRect[r].Y - INV_SLOT_SIZE_PX - 1 && j < InvRect[r].Y) { |
| 670 | done = TRUE; |
| 671 | r--; |
| 672 | } |
| 673 | } |
| 674 | if (r == 24) { |
| 675 | if ((sx & 1) == 0) |
| 676 | i -= 14; |
| 677 | if ((sy & 1) == 0) { |
| 678 | j -= 14; |
| 679 | } |
| 680 | } |
| 681 | if (r == 64 && (sy & 1) == 0) |
| 682 | j += 14; |
| 683 | } |
| 684 | if (!done) |
| 685 | return; |
| 686 | il = ILOC_UNEQUIPABLE; |
| 687 | if (r >= 0 && r <= 3) |
| 688 | il = ILOC_HELM; |
| 689 | if (r >= 4 && r <= 5) |
| 690 | il = ILOC_RING; |
| 691 | if (r == 6) |
| 692 | il = ILOC_AMULET; |
| 693 | if (r >= 7 && r <= 18) |
| 694 | il = ILOC_ONEHAND; |
| 695 | if (r >= 19 && r <= 24) |
| 696 | il = ILOC_ARMOR; |
| 697 | if (r >= 65 && r <= 72) |
| 698 | il = ILOC_BELT; |
| 699 | done = FALSE; |
| 700 | if (plr[pnum].HoldItem._iLoc == il) |
| 701 | done = TRUE; |
| 702 | if (il == ILOC_ONEHAND && plr[pnum].HoldItem._iLoc == ILOC_TWOHAND) { |
| 703 | il = ILOC_TWOHAND; |
| 704 | done = TRUE; |
| 705 | } |
| 706 | if (plr[pnum].HoldItem._iLoc == ILOC_UNEQUIPABLE && il == ILOC_BELT) { |
| 707 | if (sx == 1 && sy == 1) { |
| 708 | done = TRUE; |
| 709 | if (!AllItemsList[plr[pnum].HoldItem.IDidx].iUsable) |
| 710 | done = FALSE; |
no test coverage detected