All pastes #52661 Raw Edit

cavehippo

public text v1 · immutable
#52661 ·published 2006-05-01 19:34 UTC
rendered paste body
/* This does special processing on the 'take' command.  If the
 * player has a container open, we want to specifiy what object
 * to move from that since we've sorted it.  command is
 * the command as tped, cpnext is any optional params.
 */
void command_take (const char *command, const char *cpnext)
{
    /* If the player has specified optional data, or the player
     * does not have a container open, just issue the command
     * as normal
     */
    if (cpnext || cpl.container == NULL)
	send_command(command, cpl.count, 0);
    else {
	if (cpl.container->inv == NULL) 
	    draw_info("There is nothing in the container to move", NDI_BLACK);
	else
	    cs_print_string(csocket.fd,"move %d %d %d", cpl.ob->tag, 
		cpl.container->inv->tag, cpl.count);
    }
}