Esempio n. 1
0
void mech_createbays(dbref player, void *data, char *buffer)
{
	char *args[NUM_BAYS + 1];
	int argc;
	dbref it;
	int i;
	MECH *ds = (MECH *) data;
	MAP *map;

	DOCHECK((argc =
			 mech_parseattributes(buffer, args,
								  NUM_BAYS + 1)) == (NUM_BAYS + 1),
			"Invalid number of arguments!");
	for(i = 0; i < argc; i++) {
		it = match_thing(player, args[i]);
		DOCHECK(it == NOTHING, tprintf("Argument %d is invalid.", i + 1));
		DOCHECK(!IsMap(it), tprintf("Argument %d is not a map.", i + 1));
		map = FindObjectsData(it);
		AeroBay(ds, i) = it;
		map->onmap = ds->mynum;
	}
	for(i = argc; i < NUM_BAYS; i++)
		AeroBay(ds, i) = -1;
	notify_printf(player, "%d bay(s) set up!", argc);
}
Esempio n. 2
0
HS_DBREF CHSInterface::NoisyMatchThing(HS_DBREF player, char *name)
{
    HS_DBREF console;

#ifdef PENNMUSH                 // No change in code between versions
    console = noisy_match_result(player, name, TYPE_THING, MAT_NEAR_THINGS);
#endif

#if defined(TM3) || defined(MUX)
    console = match_thing(player, name);
#endif

    if (console == AMBIGUOUS)
        console = NOTHING;

    return console;
}
Esempio n. 3
0
// ---------------------------------------------------------------------------
// do_halt: Command interface to halt_que.
//
void do_halt(dbref executor, dbref caller, dbref enactor, int eval, int key, char *target)
{
    UNUSED_PARAMETER(caller);
    UNUSED_PARAMETER(enactor);
    UNUSED_PARAMETER(eval);

    dbref executor_targ, obj_targ;

    if ((key & HALT_ALL) && !Can_Halt(executor))
    {
        notify(executor, NOPERM_MESSAGE);
        return;
    }

    // Figure out what to halt.
    //
    if (!target || !*target)
    {
        obj_targ = NOTHING;
        if (key & HALT_ALL)
        {
            executor_targ = NOTHING;
        }
        else
        {
            executor_targ = Owner(executor);
            if (!isPlayer(executor))
            {
                obj_targ = executor;
            }
        }
    }
    else
    {
        if (Can_Halt(executor))
        {
            obj_targ = match_thing(executor, target);
        }
        else
        {
            obj_targ = match_controlled(executor, target);
        }
        if (!Good_obj(obj_targ))
        {
            return;
        }
        if (key & HALT_ALL)
        {
            notify(executor, "Can't specify a target and /all");
            return;
        }
        if (isPlayer(obj_targ))
        {
            executor_targ = obj_targ;
            obj_targ = NOTHING;
        }
        else
        {
            executor_targ = NOTHING;
        }
    }

    int numhalted = halt_que(executor_targ, obj_targ);
    if (Quiet(executor))
    {
        return;
    }
    notify(Owner(executor), tprintf("%d queue entr%s removed.", numhalted, numhalted == 1 ? "y" : "ies"));
}