version 1.33 | | version 1.34 |
---|
| | |
/* | | /* |
* static char *rcsid_shop_c = | | * static char *rcsid_shop_c = |
* "$Id: shop.c,v 1.33 2005/01/07 12:00:01 akirschbaum Exp $"; | | * "$Id: shop.c,v 1.34 2005/03/06 20:38:54 akirschbaum Exp $"; |
*/ | | */ |
| | |
/* | | /* |
| | |
else { | | else { |
if (tmp->arch != NULL) { | | if (tmp->arch != NULL) { |
if (flag == F_BUY) { | | if (flag == F_BUY) { |
LOG(llevError, "Asking for buy-value of unidentified object."); | | LOG(llevError, "Asking for buy-value of unidentified object.\n"); |
val = tmp->arch->clone.value * 50 * number; | | val = tmp->arch->clone.value * 50 * number; |
} | | } |
else { /* Trying to sell something, or get true value */ | | else { /* Trying to sell something, or get true value */ |
| | |
} else { /* No archetype with this object */ | | } else { /* No archetype with this object */ |
LOG(llevDebug,"In sell item: Have object with no archetype: %s\n", tmp->name); | | LOG(llevDebug,"In sell item: Have object with no archetype: %s\n", tmp->name); |
if (flag == F_BUY) { | | if (flag == F_BUY) { |
LOG(llevError, "Asking for buy-value of unidentified object without arch."); | | LOG(llevError, "Asking for buy-value of unidentified object without arch.\n"); |
val = number * tmp->value * 10; | | val = number * tmp->value * 10; |
} | | } |
else | | else |
| | |
uint64 total=0; | | uint64 total=0; |
| | |
if (op->type!=PLAYER && op->type!=CONTAINER) { | | if (op->type!=PLAYER && op->type!=CONTAINER) { |
LOG(llevError, "Query money called with non player/container"); | | LOG(llevError, "Query money called with non player/container\n"); |
return 0; | | return 0; |
} | | } |
for (tmp = op->inv; tmp; tmp= tmp->below) { | | for (tmp = op->inv; tmp; tmp= tmp->below) { |
| | |
for (i=0; i<NUM_COINS; i++) | | for (i=0; i<NUM_COINS; i++) |
if (coin_objs[i]==NULL) { | | if (coin_objs[i]==NULL) { |
at = find_archetype(coins[NUM_COINS-1-i]); | | at = find_archetype(coins[NUM_COINS-1-i]); |
if (at==NULL) LOG(llevError, "Could not find %s archetype", coins[NUM_COINS-1-i]); | | if (at==NULL) LOG(llevError, "Could not find %s archetype\n", coins[NUM_COINS-1-i]); |
coin_objs[i] = get_object(); | | coin_objs[i] = get_object(); |
copy_object(&at->clone, coin_objs[i]); | | copy_object(&at->clone, coin_objs[i]); |
coin_objs[i]->nrof = 0; | | coin_objs[i]->nrof = 0; |
| | |
| | |
for (count=0; coins[count]!=NULL; count++) { | | for (count=0; coins[count]!=NULL; count++) { |
at = find_archetype(coins[count]); | | at = find_archetype(coins[count]); |
if (at==NULL) LOG(llevError, "Could not find %s archetype", coins[count]); | | if (at==NULL) LOG(llevError, "Could not find %s archetype\n", coins[count]); |
else if ((i/at->clone.value) > 0) { | | else if ((i/at->clone.value) > 0) { |
for ( pouch=pl->inv ; pouch ; pouch=pouch->below ) { | | for ( pouch=pl->inv ; pouch ; pouch=pouch->below ) { |
if ( pouch->type==CONTAINER && QUERY_FLAG(pouch, FLAG_APPLIED) && pouch->race && strstr(pouch->race, "gold") ) { | | if ( pouch->type==CONTAINER && QUERY_FLAG(pouch, FLAG_APPLIED) && pouch->race && strstr(pouch->race, "gold") ) { |