Index: src/newgrf_engine.cpp =================================================================== --- src/newgrf_engine.cpp (Revision 19525) +++ src/newgrf_engine.cpp (Arbeitskopie) @@ -607,21 +607,28 @@ } case 0x45: { // Curvature info - /* Format: xxxTxBxF + /* Format: xttTbBfF * F - previous wagon to current wagon, 0 if vehicle is first * B - current wagon to next wagon, 0 if wagon is last * T - previous wagon to next wagon, 0 in an S-bend + * tt,b,f returns the amount of dH between the adjacent wagon pairs. The dH is the difference in height between the surrounding vehicles */ if (v->type != VEH_TRAIN && v->type != VEH_ROAD) return 0; const Vehicle *u_p = v->Previous(); const Vehicle *u_n = v->Next(); DirDiff f = (u_p == NULL) ? DIRDIFF_SAME : DirDifference(u_p->direction, v->direction); + int fz = (u_p == NULL) ? 0 : u_p->z_pos - v->z_pos; DirDiff b = (u_n == NULL) ? DIRDIFF_SAME : DirDifference(v->direction, u_n->direction); + int bz = (u_p == NULL) ? 0 : v->z_pos - u_n->z_pos; DirDiff t = ChangeDirDiff(f, b); + int tz = fz-bz; - return ((t > DIRDIFF_REVERSE ? t | 8 : t) << 16) | + return ((tz & 0xFF) << 20) | + ((t > DIRDIFF_REVERSE ? t | 8 : t) << 16) | + ((bz & 0xF) << 12) | ((b > DIRDIFF_REVERSE ? b | 8 : b) << 8) | + ((fz & 0xF) << 4) | ( f > DIRDIFF_REVERSE ? f | 8 : f); }