Crossfire Mailing List Archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
CF: Re: auto pickup changes
- To: crossfire (at) ifi.uio.no, "Darren O. Benham" <>
- Subject: CF: Re: auto pickup changes
- From: Jan Echternach <>
- Date: Tue, 13 Jun 2000 22:26:06 +0200
- In-Reply-To: <>; from on Tue, Jun 13, 2000 at 10:15:28PM +0200
- Mail-Followup-To: ,"Darren O. Benham" <>
- References: <>
- Reply-To: Jan Echternach <>
- Sender:
On Tue, Jun 13, 2000 at 10:15:28PM +0200, Jan Echternach wrote:
> The attached patch [...]
Hmpf.
--
Jan
diff -r -c5 orig/crossfire-0.95.5-cvs3-patch27/server/player.c crossfire-0.95.5-cvs3/server/player.c
*** orig/crossfire-0.95.5-cvs3-patch27/server/player.c Mon May 29 18:31:26 2000
--- crossfire-0.95.5-cvs3/server/player.c Tue Jun 13 21:23:21 2000
***************
*** 795,845 ****
/* check_pick sees if there is stuff to be picked up/picks up stuff.
* IT returns 1 if the player should keep on moving, 0 if he should
* stop.
*/
int check_pick(object *op) {
! if(QUERY_FLAG(op,FLAG_FLYING) || op->below==NULL || !can_pick(op,op->below))
return 1;
#ifdef SEARCH_ITEMS
if(op->contr->search_str[0]!='\0')
{
object *next,*tmp;
! tmp=op->below;
! while(tmp!=NULL&&can_pick(op,tmp))
! {
! next=tmp->below;
! if(item_matched_string(op, tmp, op->contr->search_str)) {
pick_up(op,tmp);
}
! tmp=next;
! }
}
#endif /* SEARCH_ITEMS */
switch (op->contr->mode) {
case 0: return 1; /* don't pick up */
case 1:
! pick_up(op,op->below);
return 1;
case 2:
! pick_up(op,op->below);
return 0;
case 3: return 0; /* stop before pickup */
case 4:
case 5:
case 6:
case 7: {
object *item,*temp;
! for (item = op->below; item; item=temp) {
temp = item->below;
if (can_pick(op, item)) {
if (op->contr->mode==6) {
if (QUERY_FLAG(item, FLAG_KNOWN_MAGICAL) &&
!QUERY_FLAG(item, FLAG_KNOWN_CURSED)) {
--- 795,852 ----
/* check_pick sees if there is stuff to be picked up/picks up stuff.
* IT returns 1 if the player should keep on moving, 0 if he should
* stop.
*/
int check_pick(object *op) {
+ object *first_ob;
! if (QUERY_FLAG (op, FLAG_FLYING))
! return 1;
!
! for (first_ob = op->below; first_ob != NULL; first_ob = first_ob->below)
! if (can_pick (op, first_ob))
! break;
! if (first_ob == NULL)
return 1;
#ifdef SEARCH_ITEMS
if(op->contr->search_str[0]!='\0')
{
object *next,*tmp;
! for (tmp = first_ob; tmp != NULL; tmp = next)
! {
! next = tmp->below;
! if (can_pick (op, tmp)
! && item_matched_string (op, tmp, op->contr->search_str))
! {
pick_up(op,tmp);
}
! }
}
#endif /* SEARCH_ITEMS */
switch (op->contr->mode) {
case 0: return 1; /* don't pick up */
case 1:
! pick_up (op, first_ob);
return 1;
case 2:
! pick_up (op, first_ob);
return 0;
case 3: return 0; /* stop before pickup */
case 4:
case 5:
case 6:
case 7: {
object *item,*temp;
! for (item = first_ob; item; item=temp) {
temp = item->below;
if (can_pick(op, item)) {
if (op->contr->mode==6) {
if (QUERY_FLAG(item, FLAG_KNOWN_MAGICAL) &&
!QUERY_FLAG(item, FLAG_KNOWN_CURSED)) {
***************
*** 862,880 ****
/* use value density */
default: {
object * item,*temp;
! item=op->below;
! while(item) {
temp=item->below;
if(can_pick(op, item) && !(QUERY_FLAG(item, FLAG_UNPAID)) &&
(query_cost(item,op,F_TRUE)*100/
(item->weight * MAX(item->nrof,1))>= op->contr->mode) ) {
pick_up(op,item);
}
- item=temp;
}
return 1;
}
}
--- 869,886 ----
/* use value density */
default: {
object * item,*temp;
! for (item = first_ob; item; item = temp)
! {
temp=item->below;
if(can_pick(op, item) && !(QUERY_FLAG(item, FLAG_UNPAID)) &&
(query_cost(item,op,F_TRUE)*100/
(item->weight * MAX(item->nrof,1))>= op->contr->mode) ) {
pick_up(op,item);
}
}
return 1;
}
}