order_gui.c
changeset 319 1769185de5f5
parent 193 0a7025304867
child 395 788a9bba0889
equal deleted inserted replaced
318:648afd1ab9a7 319:1769185de5f5
   167 		switch(GET_TILETYPE(tile)) {
   167 		switch(GET_TILETYPE(tile)) {
   168 		case MP_RAILWAY:
   168 		case MP_RAILWAY:
   169 			if (v->type == VEH_Train && _map_owner[tile] == _local_player) {
   169 			if (v->type == VEH_Train && _map_owner[tile] == _local_player) {
   170 				if ((_map5[tile]&0xFC)==0xC0)
   170 				if ((_map5[tile]&0xFC)==0xC0)
   171 					return (GetDepotByTile(tile)<<8) | OT_GOTO_DEPOT | OF_UNLOAD;
   171 					return (GetDepotByTile(tile)<<8) | OT_GOTO_DEPOT | OF_UNLOAD;
   172 
       
   173 				if ((_map5[tile]&0xFE)==0xC4)
       
   174 					return (GetCheckpointByTile(tile)<<8) | OT_GOTO_CHECKPOINT;
       
   175 			}
   172 			}
   176 			break;
   173 			break;
   177 
   174 
   178 		case MP_STREET:
   175 		case MP_STREET:
   179 			if ((_map5[tile] & 0xF0) == 0x20 && v->type == VEH_Road && _map_owner[tile] == _local_player)
   176 			if ((_map5[tile] & 0xF0) == 0x20 && v->type == VEH_Road && _map_owner[tile] == _local_player)
   195 				}
   192 				}
   196 				return (GetDepotByTile(tile)<<8) | OT_GOTO_DEPOT | OF_UNLOAD;
   193 				return (GetDepotByTile(tile)<<8) | OT_GOTO_DEPOT | OF_UNLOAD;
   197 			}
   194 			}
   198 		}
   195 		}
   199 	}
   196 	}
       
   197 
       
   198 	// check checkpoint
       
   199 	if (IS_TILETYPE(tile, MP_RAILWAY)
       
   200 	&& v->type == VEH_Train 
       
   201 	&& _map_owner[tile] == _local_player
       
   202 	&& (_map5[tile]&0xFE)==0xC4)
       
   203 		return (GetCheckpointByTile(tile)<<8) | OT_GOTO_CHECKPOINT;
   200 
   204 
   201 	if (IS_TILETYPE(tile, MP_STATION)) {
   205 	if (IS_TILETYPE(tile, MP_STATION)) {
   202 		st = DEREF_STATION(st_index = _map2[tile]);
   206 		st = DEREF_STATION(st_index = _map2[tile]);
   203 
   207 
   204 		if (st->owner == _current_player || st->owner == OWNER_NONE) {
   208 		if (st->owner == _current_player || st->owner == OWNER_NONE) {