src/ship_cmd.cpp
changeset 5991 ec2eebfe86de
parent 5972 59953719a3ff
child 5993 956d341d930e
equal deleted inserted replaced
5990:280fbef32d44 5991:ec2eebfe86de
   698 			gp.x = v->x_pos;
   698 			gp.x = v->x_pos;
   699 			gp.y = v->y_pos;
   699 			gp.y = v->y_pos;
   700 		} else {
   700 		} else {
   701 			/* isnot inside depot */
   701 			/* isnot inside depot */
   702 			r = VehicleEnterTile(v, gp.new_tile, gp.x, gp.y);
   702 			r = VehicleEnterTile(v, gp.new_tile, gp.x, gp.y);
   703 			if (r & 0x8) goto reverse_direction;
   703 			if (HASBIT(r, VETS_CANNOT_ENTER)) goto reverse_direction;
   704 
   704 
   705 			/* A leave station order only needs one tick to get processed, so we can
   705 			/* A leave station order only needs one tick to get processed, so we can
   706 			 * always skip ahead. */
   706 			 * always skip ahead. */
   707 			if (v->current_order.type == OT_LEAVESTATION) {
   707 			if (v->current_order.type == OT_LEAVESTATION) {
   708 				v->current_order.type = OT_NOTHING;
   708 				v->current_order.type = OT_NOTHING;
   778 		gp.x = (gp.x&~0xF) | b[0];
   778 		gp.x = (gp.x&~0xF) | b[0];
   779 		gp.y = (gp.y&~0xF) | b[1];
   779 		gp.y = (gp.y&~0xF) | b[1];
   780 
   780 
   781 		/* Call the landscape function and tell it that the vehicle entered the tile */
   781 		/* Call the landscape function and tell it that the vehicle entered the tile */
   782 		r = VehicleEnterTile(v, gp.new_tile, gp.x, gp.y);
   782 		r = VehicleEnterTile(v, gp.new_tile, gp.x, gp.y);
   783 		if (r&0x8) goto reverse_direction;
   783 		if (HASBIT(r, VETS_CANNOT_ENTER)) goto reverse_direction;
   784 
   784 
   785 		if (!(r&0x4)) {
   785 		if (!HASBIT(r, VETS_ENTERED_WORMHOLE)) {
   786 			v->tile = gp.new_tile;
   786 			v->tile = gp.new_tile;
   787 			v->u.ship.state = TrackToTrackBits(track);
   787 			v->u.ship.state = TrackToTrackBits(track);
   788 		}
   788 		}
   789 
   789 
   790 		v->direction = (Direction)b[2];
   790 		v->direction = (Direction)b[2];