First, the temp_z was just arbitrarily set to somewhere above the assumed point where the trace would intersect the terrain. Result could not be used because the c_trace has not been done yet, not until the tipi villagae has been created. I don't know what value result will have, probably zero.
An alternative to the if(result)... line would be using:

temp.z = my.z - result;
vec_set(my.pos,temp);

where result is the distance of the vertical trace from its origin (me, the tipi_village) to the target (the vector position where the trace interscts the terrain).

Not sure why the other line would produce an error ... what did it say?