… | |
… | |
23 | |
23 | |
24 | #include <global.h> |
24 | #include <global.h> |
25 | #include <spells.h> |
25 | #include <spells.h> |
26 | #include <skills.h> |
26 | #include <skills.h> |
27 | #include <living.h> |
27 | #include <living.h> |
28 | #include <newclient.h> |
|
|
29 | #ifndef __CEXTRACT__ |
|
|
30 | # include <sproto.h> |
28 | #include <sproto.h> |
31 | #endif |
|
|
32 | #include <math.h> |
29 | #include <math.h> |
33 | |
30 | |
34 | /* this is a measure of how effective store specialisation is. A general store |
31 | /* this is a measure of how effective store specialisation is. A general store |
35 | * will offer this proportion of the 'maximum' price, a specialised store will |
32 | * will offer this proportion of the 'maximum' price, a specialised store will |
36 | * offer a range of prices around it such that the maximum price is always one |
33 | * offer a range of prices around it such that the maximum price is always one |
… | |
… | |
593 | { |
590 | { |
594 | LOG (llevError, "%s has two money entries of (%s)\n", &pouch->name, coins[NUM_COINS - 1 - i]); |
591 | LOG (llevError, "%s has two money entries of (%s)\n", &pouch->name, coins[NUM_COINS - 1 - i]); |
595 | tmp->remove (); |
592 | tmp->remove (); |
596 | coin_objs[i]->nrof += tmp->nrof; |
593 | coin_objs[i]->nrof += tmp->nrof; |
597 | esrv_del_item (pl->contr, tmp->count); |
594 | esrv_del_item (pl->contr, tmp->count); |
598 | tmp->destroy (0); |
595 | tmp->destroy (); |
599 | } |
596 | } |
600 | else |
597 | else |
601 | { |
598 | { |
602 | tmp->remove (); |
599 | tmp->remove (); |
603 | |
600 | |
… | |
… | |
666 | |
663 | |
667 | if (pl->type != PLAYER) |
664 | if (pl->type != PLAYER) |
668 | esrv_send_item (pl, pl); |
665 | esrv_send_item (pl, pl); |
669 | } |
666 | } |
670 | else |
667 | else |
671 | coin_objs[i]->destroy (0); |
668 | coin_objs[i]->destroy (); |
672 | } |
669 | } |
673 | } |
670 | } |
674 | |
671 | |
675 | /* Checks all unpaid items in op's inventory, adds up all the money they |
672 | /* Checks all unpaid items in op's inventory, adds up all the money they |
676 | * have, and checks that they can actually afford what they want to buy. |
673 | * have, and checks that they can actually afford what they want to buy. |
… | |
… | |
1178 | case RING: |
1175 | case RING: |
1179 | case AMULET: |
1176 | case AMULET: |
1180 | case BRACERS: |
1177 | case BRACERS: |
1181 | case GIRDLE: |
1178 | case GIRDLE: |
1182 | sprintf (buf, "%s %s", query_base_name (tmp, 0), describe_item (tmp, NULL)); |
1179 | sprintf (buf, "%s %s", query_base_name (tmp, 0), describe_item (tmp, NULL)); |
1183 | items[*numitems].item_sort = strdup_local (buf); |
1180 | items[*numitems].item_sort = strdup (buf); |
1184 | sprintf (buf, "%s %s", query_name (tmp), describe_item (tmp, NULL)); |
1181 | sprintf (buf, "%s %s", query_name (tmp), describe_item (tmp, NULL)); |
1185 | items[*numitems].item_real = strdup_local (buf); |
1182 | items[*numitems].item_real = strdup (buf); |
1186 | (*numitems)++; |
1183 | (*numitems)++; |
1187 | break; |
1184 | break; |
1188 | #endif |
1185 | #endif |
1189 | |
1186 | |
1190 | default: |
1187 | default: |
1191 | items[*numitems].item_sort = strdup_local (query_base_name (tmp, 0)); |
1188 | items[*numitems].item_sort = strdup (query_base_name (tmp, 0)); |
1192 | items[*numitems].item_real = strdup_local (query_base_name (tmp, 1)); |
1189 | items[*numitems].item_real = strdup (query_base_name (tmp, 1)); |
1193 | (*numitems)++; |
1190 | (*numitems)++; |
1194 | break; |
1191 | break; |
1195 | } |
1192 | } |
1196 | SET_FLAG (tmp, FLAG_UNPAID); |
1193 | SET_FLAG (tmp, FLAG_UNPAID); |
1197 | } |
1194 | } |