order_cmd.c
changeset 2549 f1d3b383d557
parent 2433 5f55c796b85b
child 2617 a9e1a187de99
--- a/order_cmd.c	Sat Oct 22 06:39:32 2005 +0000
+++ b/order_cmd.c	Sun Oct 23 13:04:44 2005 +0000
@@ -851,25 +851,23 @@
  */
 bool CheckOrders(uint data_a, uint data_b)
 {
-	Vehicle *v = GetVehicle(data_a);
+	const Vehicle* v = GetVehicle(data_a);
+
 	/* Does the user wants us to check things? */
-	if (_patches.order_review_system == 0)
-		return false;
+	if (_patches.order_review_system == 0) return false;
 
 	/* Do nothing for crashed vehicles */
-	if(v->vehstatus & VS_CRASHED)
-		return false;
+	if (v->vehstatus & VS_CRASHED) return false;
 
 	/* Do nothing for stopped vehicles if setting is '1' */
-	if ( (_patches.order_review_system == 1) && (v->vehstatus & VS_STOPPED) )
+	if (_patches.order_review_system == 1 && v->vehstatus & VS_STOPPED)
 		return false;
 
 	/* do nothing we we're not the first vehicle in a share-chain */
-	if (v->next_shared != NULL)
-		return false;
+	if (v->next_shared != NULL) return false;
 
 	/* Only check every 20 days, so that we don't flood the message log */
-	if ( (v->owner == _local_player) && (v->day_counter % 20 == 0) ) {
+	if (v->owner == _local_player && v->day_counter % 20 == 0) {
 		int n_st, problem_type = -1;
 		const Order *order;
 		const Station *st;
@@ -930,7 +928,7 @@
 			return true;
 		}
 
-		message = (STR_TRAIN_HAS_TOO_FEW_ORDERS) + (((v->type) - VEH_Train) << 2) + problem_type;
+		message = STR_TRAIN_HAS_TOO_FEW_ORDERS + ((v->type - VEH_Train) << 2) + problem_type;
 		/*DEBUG(misc, 3) ("Checkorder mode 0: Triggered News Item for %d", v->index);*/
 
 		SetDParam(0, v->unitnumber);