Exemple #1
0
 @Override
 public boolean okMessage(final Environmental myHost, final CMMsg msg) {
   if ((affected != null)
       && (((msg.target() instanceof Room) && (msg.targetMinor() == CMMsg.TYP_ENTER))
           || ((msg.target() instanceof Rideable) && (msg.targetMinor() == CMMsg.TYP_SIT)))
       && ((msg.amITarget(affected)) || (msg.tool() == affected) || (affected instanceof Area))
       && (!CMLib.flags().isFalling(msg.source()))) {
     final HashSet<MOB> H = new HashSet<MOB>();
     if (noFollow) H.add(msg.source());
     else {
       msg.source().getGroupMembers(H);
       int hsize = 0;
       while (hsize != H.size()) {
         hsize = H.size();
         final HashSet H2 = (HashSet) H.clone();
         for (final Iterator e = H2.iterator(); e.hasNext(); ) {
           final Object O = e.next();
           if (O instanceof MOB) ((MOB) O).getRideBuddies(H);
         }
       }
     }
     for (final Object O : H) {
       if ((!(O instanceof MOB)) || (passesMuster((MOB) O))) return super.okMessage(myHost, msg);
     }
     msg.source().tell(L("You are not allowed in there."));
     return false;
   }
   return super.okMessage(myHost, msg);
 }