station_cmd.c
changeset 426 381172276dc6
parent 413 36f14a6d63d7
child 433 a2cbd6cf3f37
equal deleted inserted replaced
425:97d601c182f0 426:381172276dc6
  1033 						/* FIXME: This is ad hoc only
  1033 						/* FIXME: This is ad hoc only
  1034 						 * for waypoints. */
  1034 						 * for waypoints. */
  1035 						value = 0x01010000;
  1035 						value = 0x01010000;
  1036 					} else {
  1036 					} else {
  1037 						/* TODO: Only small fraction done. */
  1037 						/* TODO: Only small fraction done. */
  1038 						// 0x80 + offset - 0x10
  1038 						// TTDPatch runs on little-endian arch;
       
  1039 						// Variable is 0x70 + offset in the TTD's station structure
  1039 						switch (dsg->variable - 0x70) {
  1040 						switch (dsg->variable - 0x70) {
  1040 							case 0x80:
  1041 							case 0x80:
  1041 								if (stat) value = stat->facilities;
  1042 								if (stat) value = stat->facilities;
  1042 								break;
  1043 								break;
  1043 							case 0x81:
  1044 							case 0x81:
  1051 								break;
  1052 								break;
  1052 							case 0x86:
  1053 							case 0x86:
  1053 								if (stat) value = stat->airport_flags & 0xFFFF;
  1054 								if (stat) value = stat->airport_flags & 0xFFFF;
  1054 								break;
  1055 								break;
  1055 							case 0x87:
  1056 							case 0x87:
  1056 								if (stat) value = (stat->airport_flags >> 8) & 0xFF;
  1057 								if (stat) value = stat->airport_flags & 0xFF;
  1057 								break;
  1058 								break;
  1058 							case 0x8A:
  1059 							case 0x8A:
  1059 								if (stat) value = stat->build_date;
  1060 								if (stat) value = stat->build_date;
  1060 								break;
  1061 								break;
  1061 						}
  1062 						}