Changeset - r14368:c681dc336057
[Not reviewed]
master
0 1 0
rubidium - 15 years ago 2010-01-28 18:19:34
rubidium@openttd.org
(svn r18935) -Fix [FS#3551] (r18764): value of variables 90 and 91 weren't what NARS expects
1 file changed with 14 insertions and 2 deletions:
0 comments (0 inline, 0 general)
src/newgrf_engine.cpp
Show inline comments
 
@@ -711,8 +711,20 @@ static uint32 VehicleGetVariable(const R
 
		case 0x0B: return v->current_order.GetDestination();
 
		case 0x0C: return v->GetNumOrders();
 
		case 0x0D: return v->cur_order_index;
 
		case 0x10: return v->load_unload_ticks;
 
		case 0x11: return GB(v->load_unload_ticks, 8, 8);
 
		case 0x10:
 
		case 0x11: {
 
			uint ticks;
 
			if (v->current_order.IsType(OT_LOADING)) {
 
				ticks = v->load_unload_ticks;
 
			} else {
 
				switch (v->type) {
 
					case VEH_TRAIN:    ticks = Train::From(v)->wait_counter; break;
 
					case VEH_AIRCRAFT: ticks = Aircraft::From(v)->turn_counter; break;
 
					default:           ticks = 0; break;
 
				}
 
			}
 
			return (variable - 0x80) == 0x10 ? ticks : GB(ticks, 8, 8);
 
		}
 
		case 0x12: return max(v->date_of_last_service - DAYS_TILL_ORIGINAL_BASE_YEAR, 0);
 
		case 0x13: return GB(max(v->date_of_last_service - DAYS_TILL_ORIGINAL_BASE_YEAR, 0), 8, 8);
 
		case 0x14: return v->service_interval;
0 comments (0 inline, 0 general)