public void roomAffectFully(CMMsg msg, Room room, int dirCode) { room.send(msg.source(), msg); if ((msg.target() == null) || (!(msg.target() instanceof Exit))) return; if (dirCode < 0) { for (int d = Directions.NUM_DIRECTIONS() - 1; d >= 0; d--) if (room.getExitInDir(d) == msg.target()) { dirCode = d; break; } } if (dirCode < 0) return; Exit pair = room.getPairedExit(dirCode); if (pair != null) { CMMsg altMsg = null; if ((msg.targetCode() == CMMsg.MSG_OPEN) && (pair.isLocked())) { altMsg = CMClass.getMsg( msg.source(), pair, msg.tool(), CMMsg.MSG_UNLOCK, null, CMMsg.MSG_UNLOCK, null, CMMsg.MSG_UNLOCK, null); pair.executeMsg(msg.source(), altMsg); } altMsg = CMClass.getMsg( msg.source(), pair, msg.tool(), msg.sourceCode(), null, msg.targetCode(), null, msg.othersCode(), null); pair.executeMsg(msg.source(), altMsg); } }