
 ------------请各位天神注意，MUDOS原码中可能有如下bug------------

/*
/*  请修改MudOS源程序中的simulate.c替换原有的enable_commands()函数
/*

#ifndef NO_ADD_ACTION
void enable_commands P1(int, num)
{
#ifndef NO_ENVIRONMENT
    object_t *pp;
#endif

    if (current_object->flags & O_DESTRUCTED)
    return;
#ifdef DEBUG
    if (d_flag > 1) {
    debug_message("Enable commands /%s (ref %d)\n",
              current_object->name, current_object->ref);
    }
#endif
    if (num) {
        if (current_object->flags & O_ENABLE_COMMANDS)
            return;
        current_object->flags |= O_ENABLE_COMMANDS;
        command_giver = current_object;
#ifndef NO_ENVIRONMENT
        if (current_object->super){
            (void) apply(APPLY_INIT, current_object->super, 0, ORIGIN_DRIVER);
             for (pp = current_object->super->contains; pp; pp = pp->next_inv) {
                 if (current_object==pp)  continue;
                 if (pp->flags & O_ENABLE_COMMANDS) {
                     command_giver = pp;
                     (void) apply(APPLY_INIT, current_object, 0, ORIGIN_DRIVER);

                 }
                command_giver=current_object;
                (void) apply(APPLY_INIT, pp, 0, ORIGIN_DRIVER);
            }
        }
        if (current_object->contains){
            for (pp = current_object->contains; pp; pp = pp->next_inv)
                     (void) apply(APPLY_INIT, pp, 0, ORIGIN_DRIVER);
        }
#endif
    } else {
    /*
     * Remove all sentences defined by this object from all objects here.
     */
#ifndef NO_ENVIRONMENT
    if (current_object->flags & O_ENABLE_COMMANDS) {
            if (current_object->super) {
                remove_sent(current_object->super,current_object);
                remove_sent(current_object, current_object->super);
                for (pp = current_object->super->contains; pp; pp = pp->next_in)

 {
                    remove_sent(current_object, pp);
                    remove_sent(pp,current_object);
                }
                for (pp = current_object->contains; pp; pp = pp->next_inv) {
                    remove_sent(current_object, pp);
                    remove_sent(pp,current_object);
                }
            }
    }
#endif
    current_object->flags &= ~O_ENABLE_COMMANDS;
    command_giver = 0;
    }
