… | |
… | |
1008 | CHK_PICK_PICKUP; |
1008 | CHK_PICK_PICKUP; |
1009 | |
1009 | |
1010 | continue; |
1010 | continue; |
1011 | } |
1011 | } |
1012 | |
1012 | |
1013 | /* NEW pickup handling */ |
1013 | /* pickup handling */ |
1014 | if (op->contr->mode & PU_DEBUG) |
1014 | if (op->contr->mode & PU_DEBUG) |
1015 | { |
1015 | { |
1016 | /* some debugging code to figure out item information */ |
1016 | /* some debugging code to figure out item information */ |
1017 | const char *str = tmp->name |
1017 | const char *str = tmp->name |
1018 | ? format ("item name: %s item type: %d weight/value: %d", |
1018 | ? format ("item name: %s item type: %d weight/value: %d", |
… | |
… | |
1020 | : format ("item name: %s item type: %d weight/value: %d", |
1020 | : format ("item name: %s item type: %d weight/value: %d", |
1021 | &tmp->arch->archname, tmp->type, (int) (query_cost (tmp, op, F_TRUE) * 100 / (tmp->weight * MAX (tmp->nrof, 1)))); |
1021 | &tmp->arch->archname, tmp->type, (int) (query_cost (tmp, op, F_TRUE) * 100 / (tmp->weight * MAX (tmp->nrof, 1)))); |
1022 | |
1022 | |
1023 | new_draw_info (NDI_UNIQUE, 0, op, str); |
1023 | new_draw_info (NDI_UNIQUE, 0, op, str); |
1024 | } |
1024 | } |
|
|
1025 | |
|
|
1026 | if (op->contr->mode & PU_INHIBIT) |
|
|
1027 | return 1; |
|
|
1028 | |
|
|
1029 | if (!(op->contr->mode & PU_ENABLE)) // TODO: fix client |
|
|
1030 | return 1; |
1025 | |
1031 | |
1026 | /* philosophy: |
1032 | /* philosophy: |
1027 | * It's easy to grab an item type from a pile, as long as it's |
1033 | * It's easy to grab an item type from a pile, as long as it's |
1028 | * generic. This takes no game-time. For more detailed pickups |
1034 | * generic. This takes no game-time. For more detailed pickups |
1029 | * and selections, select-items should be used. This is a |
1035 | * and selections, select-items should be used. This is a |
… | |
… | |
1037 | /* the first two modes are exclusive: if NOTHING we return, if |
1043 | /* the first two modes are exclusive: if NOTHING we return, if |
1038 | * STOP then we stop. All the rest are applied sequentially, |
1044 | * STOP then we stop. All the rest are applied sequentially, |
1039 | * meaning if any test passes, the item gets picked up. */ |
1045 | * meaning if any test passes, the item gets picked up. */ |
1040 | |
1046 | |
1041 | /* if mode is set to pick nothing up, return */ |
1047 | /* if mode is set to pick nothing up, return */ |
1042 | if (op->contr->mode & PU_NOTHING) |
1048 | if (op->contr->mode == PU_NOTHING) |
1043 | return 1; |
1049 | return 1; |
1044 | |
1050 | |
1045 | /* if mode is set to stop when encountering objects, return */ |
1051 | /* if mode is set to stop when encountering objects, return */ |
1046 | /* take STOP before INHIBIT since it doesn't actually pick |
1052 | /* take STOP before INHIBIT since it doesn't actually pick |
1047 | * anything up */ |
1053 | * anything up */ |