Hi ,
thank you for your answer!
First of all, it might be interesting for you that there exists a Cast Template inside of Cast.h which can be used for such cases:
template< class T > T* Cast( UObject* Src )
{
CATCH_UNSUPPORTED_INTERFACECAST(T);
return Src && Src->IsA<T>() ? (T*)Src : NULL;
}
Basically it has built in the checks you have mentioned (as you can see).
Nevertheless, i think it would be bad programming style to do this cast in every Method where it is needed. Especially if one PlayerController should be used to posses a wide variety of Characters/Pawns or the Characters/Pawns have many unique methods called from within the PlayerController.
After reading a little bit deeper into the engine code and the UnrealTournament Implementation of UTPlayerController i think i have found a somewhat better solution. I will post this as a Extra Answer to my original Question and would be pleased if you could give your thoughts to the solution (If something is fundamentally wrong, which could cause problems in the long run).