You don't need to search through the vehicle code, the code at the start of
step_in_field does exactly what you want to do.
On May 7, 2013 12:31 PM, "indigochill" <notifications@github.com> wrote:

> In field.cpp:
>
> > @@ -1024,3 +1024,32 @@ bool vector_has(std::vector <item> vec, itype_id type)
> >   }
> >   return false;
> >  }
> > +
> > +void map::field_effect(int x, int y, game *g) //Applies effect of field immediately
> > +{
> > + field *cur = &field_at(x, y);
> > + switch (cur->type) {                        //Can add independent code for different types of fields to apply different effects
> > +  case fd_rubble:
> > +   int fdmon = g->mon_at(x, y);              //The index of the monster at (x,y), or -1 if there isn't one
> > +   int fdnpc = g->npc_at(x, y);              //The index of the NPC at (x,y), or -1 if there isn't one
> > +   if (g->u.posx == x && g->u.posy == y) {
> > +    g->u.hurtall(10);                         //Avoiding disease system for the moment, since I was having trouble with it.
>
> I made a change that makes just being "in" a vehicle enough to grant
> immunity to getting hit by rubble. This means you could bicycle through a
> collapsing building no problem, which obviously needs fixing.
>
> I'm currently reading through the vehicle code trying to figure out how to
> determine the type (and status) of a vehicle part at a given coordinate so
> that I can handle roofs properly.
>
> —
> Reply to this email directly or view it on GitHub<https://github.com/TheDarklingWolf/Cataclysm-DDA/pull/856/files#r4118286>
> .
>