Added faction check.
Dynamic_casting, checking rank. Commented out faction check, since it will not work.