karpathy/scriptsbots — comment on commit 86f758292f07f64719fde9081c1302b70a8e0a47
File: GLView.cpp line 220
By GhengopelALPHA:

This whole bit of code can be simplified to this to solve problems with agent selection while" following selected agent" mode is on:
if(following!=0){
float xi=0, yi=0;
world->positionOfInterest(following, xi, yi);
xtranslate= -xi; ytranslate= -yi;
//reset this if there is no interest. Probably agent that was followed died
if(xi==0 && yi==0) following = 0;
}