Fix emoticon name length checking.
tga loader: use unsigned for image dimensions.
Check parsed client no. before using it.
Refactor AIEntityToGentity; avoid mixing enum types.