… | |
… | |
126 | { |
126 | { |
127 | if (tmp->arch != NULL) |
127 | if (tmp->arch != NULL) |
128 | { |
128 | { |
129 | if (flag == F_BUY) |
129 | if (flag == F_BUY) |
130 | { |
130 | { |
131 | LOG (llevError, "Asking for buy-value of unidentified object.\n"); |
131 | LOG (llevError | logBacktrace, "Asking for buy-value of unidentified object.\n"); |
132 | val = tmp->arch->value * 50 * number; |
132 | val = tmp->arch->value * 50 * number; |
133 | } |
133 | } |
134 | else |
134 | else |
135 | { /* Trying to sell something, or get true value */ |
135 | { /* Trying to sell something, or get true value */ |
136 | if (tmp->type == POTION) |
136 | if (tmp->type == POTION) |
… | |
… | |
150 | else |
150 | else |
151 | { /* No archetype with this object */ |
151 | { /* No archetype with this object */ |
152 | LOG (llevDebug, "In sell item: Have object with no archetype: %s\n", &tmp->name); |
152 | LOG (llevDebug, "In sell item: Have object with no archetype: %s\n", &tmp->name); |
153 | if (flag == F_BUY) |
153 | if (flag == F_BUY) |
154 | { |
154 | { |
155 | LOG (llevError, "Asking for buy-value of unidentified object without arch.\n"); |
155 | LOG (llevError | logBacktrace, "Asking for buy-value of unidentified object without arch.\n"); |
156 | val = number * tmp->value * 10; |
156 | val = number * tmp->value * 10; |
157 | } |
157 | } |
158 | else |
158 | else |
159 | val = number * tmp->value / 5; |
159 | val = number * tmp->value / 5; |
160 | } |
160 | } |
… | |
… | |
631 | count--; |
631 | count--; |
632 | } |
632 | } |
633 | } |
633 | } |
634 | |
634 | |
635 | for (i = 0; i < NUM_COINS; i++) |
635 | for (i = 0; i < NUM_COINS; i++) |
636 | { |
|
|
637 | if (coin_objs[i]->nrof) |
636 | if (coin_objs[i]->nrof) |
638 | insert_ob_in_ob (coin_objs [i], pouch); |
637 | insert_ob_in_ob (coin_objs [i], pouch); |
639 | else |
638 | else |
640 | coin_objs[i]->destroy (); |
639 | coin_objs[i]->destroy (); |
641 | } |
|
|
642 | } |
640 | } |
643 | |
641 | |
644 | /* Checks all unpaid items in op's inventory, adds up all the money they |
642 | /* Checks all unpaid items in op's inventory, adds up all the money they |
645 | * have, and checks that they can actually afford what they want to buy. |
643 | * have, and checks that they can actually afford what they want to buy. |
646 | * Returns 1 if they can, and 0 if they can't. also prints an appropriate message |
644 | * Returns 1 if they can, and 0 if they can't. also prints an appropriate message |