The reason that your first example does not yield the desired result (set the you pointer) is that the my pointer is NULL in the main function.
c_scan does not have an entity parameter (compared to let's say c_move) as you are aware:

c_scan (VECTOR* pos, ANGLE* ang, VECTOR* sector, var mode)

When you use ent1->x and ent1->pan as arguments you "lose" all context to the entity (ent1).
Workaround for keeping it in the main function:

me = ent1; // or save the old me pointer in case you use stuff like this somewhere else, ENTITY* oldMe = me;
c_scan(...);
me = NULL; // me = oldMe;


"Falls das Resultat nicht einfach nur dermassen gut aussieht, sollten Sie nochmal von vorn anfangen..." - Manual

Check out my new game: Pogostuck: Rage With Your Friends