I just think that the function just gegt called as long the character is over 800. So as long the character is this far away the function callls every frame. Do you set him in the middle again?
so like
Code:
if(character.x > 800)
{
 shift_map();
 character.x = 0; 
}

?