Tracking mode handled in a function ("last camera mode" is now important)

+ Some refactoring
+ "entity is near" = 2000.0 (3000.0 before)