/*
This is to allow player-characters to look into rooms next to the room they are in so they can see MOBs that are present, 
similar to scan on many MUDs. Ut was created for Throes of Creation, which uses CoffeeMud v5.2.4, after a request by Ben Malone.

CoffeeMud is Copyright 2000-2009 Bo Zimmerman, and was released under the Apache License, Version 2.0.

Permission to use and modify granted.

Unless required by applicable law or agreed to in writing, this software is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
*/



//Added to CommonMsgs.java:

    //mabus, to add mobs to looking at exits, from here
    public void scanExit(Room room, Exit exit, MOB mob)
    {
        if((mob==null)||(room==null)||(mob.isMonster())) return;
        if(exit==null)
        {
              mob.tell("You do not see that exit.");
              return;
        }
        if(!CMLib.flags().canSee(mob))
        {
            mob.tell("You can't see anything!");
            return;
        }
        StringBuffer Scan=new StringBuffer("");
        if((CMLib.flags().canBeSeenBy(exit,mob))
        &&(CMLib.flags().canBeSeenBy(room,mob))
        &&((exit.isOpen()&&exit.hasADoor())||(!exit.hasADoor()))
        &&(CMLib.flags().isSeen(exit)))
        {

            if(room.numInhabitants() > 0)
            {
                  Scan.append("\n\rYou also see: ");
                  for(int m=0;m<room.numInhabitants();m++)
                  {
                      MOB rm=null;
                      rm=room.fetchInhabitant(m);
                      if((rm != null)&&(CMLib.flags().canBeSeenBy(rm,mob))) Scan.append(rm.Name());
                      if(m<(room.numInhabitants()-1))
                               Scan.append(", ");
                      else
                               Scan.append(".");
                  }
            }
        }
            mob.tell(Scan.toString());
    }
    //mabus, to add mobs to looking at exits, to here

//Added to Libraries/interfaces/CommonCommands.java:

public void scanExit(Room room, Exit exit, MOB mob); //mabus


Added to Commands/Look.java
/*
After:

                if((thisThang instanceof Room)&&(CMath.bset(mob.getBitmap(),MOB.ATT_AUTOEXITS)))
                {
                    CMLib.commands().lookAtExits((Room)thisThang,mob);
                }
*/
Add:
                //mabus, to add mobs to looking at exits, from here
                if(thisThang instanceof Exit)
                {
                    dirCode=Directions.getGoodDirectionCode(ID);
                    Room room=R.getRoomInDir(dirCode);
                    if(room !=null) CMLib.commands().scanExit(room,(Exit)thisThang,mob);
                    return false;
                }
                //mabus, to add mobs to looking at exits, to here