Crossfire Archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

CF: Patch: minor 'get improvement



Hi,

this is a little improvement for the 'get command: "'drop foobar" puts
things into an container, if there is an open container. "'get foobar"
picks up things from the ground, even if there is a container. This
patch modifies the 'get command to work as expected.

------------------------------ Cut ------------------------------

diff -r -C 5 crossfire-0.93.7/server/c_object.c crossfire/server/c_object.c
*** crossfire-0.93.7/server/c_object.c	Tue Jan  6 10:29:23 1998
--- crossfire/server/c_object.c	Fri Jan  9 13:53:15 1998
***************
*** 542,553 ****
  }
  
  
  int command_take (object *op, char *params)
  {
!     object *tmp=op->below, *next;
  
      if (tmp==NULL) {
  	new_draw_info(NDI_UNIQUE, 0,op,"Nothing to take!");
  	return 0;
      }
  
--- 542,554 ----
  }
  
  
  int command_take (object *op, char *params)
  {
!     object *tmp, *next;
  
+     tmp=(op->container) ? op->container->inv : op->below;
      if (tmp==NULL) {
  	new_draw_info(NDI_UNIQUE, 0,op,"Nothing to take!");
  	return 0;
      }
  
[to unsubscribe etc., send mail to crossfire-request@ifi.uio.no]