Engine modification.

Completely changed the invasion handling by the engine. WARNING: May
have introduced new bugs into the game.