mirror of
https://github.com/JGRennison/OpenTTD-patches.git
synced 2024-10-31 15:20:10 +00:00
Codechange: rename next_station to next_hop to avoid confusing with another next_station
This commit is contained in:
parent
a0f6983be4
commit
9f8c1ea552
@ -167,7 +167,7 @@ bool CargoTransfer::operator()(CargoPacket *cp)
|
|||||||
if (cp_new == nullptr) return false;
|
if (cp_new == nullptr) return false;
|
||||||
this->source->RemoveFromMeta(cp_new, VehicleCargoList::MTA_TRANSFER, cp_new->Count());
|
this->source->RemoveFromMeta(cp_new, VehicleCargoList::MTA_TRANSFER, cp_new->Count());
|
||||||
/* No transfer credits here as they were already granted during Stage(). */
|
/* No transfer credits here as they were already granted during Stage(). */
|
||||||
this->destination->Append(cp_new, cp_new->GetNextStation());
|
this->destination->Append(cp_new, cp_new->GetNextHop());
|
||||||
return cp_new == cp;
|
return cp_new == cp;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -217,8 +217,8 @@ bool VehicleCargoReroute::operator()(CargoPacket *cp)
|
|||||||
{
|
{
|
||||||
CargoPacket *cp_new = this->Preprocess(cp);
|
CargoPacket *cp_new = this->Preprocess(cp);
|
||||||
if (cp_new == nullptr) cp_new = cp;
|
if (cp_new == nullptr) cp_new = cp;
|
||||||
if (cp_new->GetNextStation() == this->avoid || cp_new->GetNextStation() == this->avoid2) {
|
if (cp_new->GetNextHop() == this->avoid || cp_new->GetNextHop() == this->avoid2) {
|
||||||
cp->SetNextStation(this->ge->GetVia(cp_new->GetFirstStation(), this->avoid, this->avoid2));
|
cp->SetNextHop(this->ge->GetVia(cp_new->GetFirstStation(), this->avoid, this->avoid2));
|
||||||
}
|
}
|
||||||
if (this->source != this->destination) {
|
if (this->source != this->destination) {
|
||||||
this->source->RemoveFromMeta(cp_new, VehicleCargoList::MTA_TRANSFER, cp_new->Count());
|
this->source->RemoveFromMeta(cp_new, VehicleCargoList::MTA_TRANSFER, cp_new->Count());
|
||||||
|
@ -57,7 +57,7 @@ CargoPacket::CargoPacket(StationID first_station, TileIndex source_xy, uint16_t
|
|||||||
* @param count Number of cargo entities to put in this packet.
|
* @param count Number of cargo entities to put in this packet.
|
||||||
* @param periods_in_transit Number of cargo aging periods the cargo has been in transit.
|
* @param periods_in_transit Number of cargo aging periods the cargo has been in transit.
|
||||||
* @param first_station Station the cargo was initially loaded.
|
* @param first_station Station the cargo was initially loaded.
|
||||||
* @param next_station Next station the cargo wants to go.
|
* @param next_hop Next station the cargo wants to go.
|
||||||
* @param source_xy Station location the cargo was initially loaded.
|
* @param source_xy Station location the cargo was initially loaded.
|
||||||
* @param feeder_share Feeder share the packet has already accumulated.
|
* @param feeder_share Feeder share the packet has already accumulated.
|
||||||
* @param source_type 'Type' of source the packet comes from (for subsidies).
|
* @param source_type 'Type' of source the packet comes from (for subsidies).
|
||||||
@ -65,7 +65,7 @@ CargoPacket::CargoPacket(StationID first_station, TileIndex source_xy, uint16_t
|
|||||||
* @note We have to zero memory ourselves here because we are using a 'new'
|
* @note We have to zero memory ourselves here because we are using a 'new'
|
||||||
* that, in contrary to all other pools, does not memset to 0.
|
* that, in contrary to all other pools, does not memset to 0.
|
||||||
*/
|
*/
|
||||||
CargoPacket::CargoPacket(uint16_t count, uint16_t periods_in_transit, StationID first_station, StationID next_station, TileIndex source_xy, Money feeder_share, SourceType source_type, SourceID source_id) :
|
CargoPacket::CargoPacket(uint16_t count, uint16_t periods_in_transit, StationID first_station, StationID next_hop, TileIndex source_xy, Money feeder_share, SourceType source_type, SourceID source_id) :
|
||||||
count(count),
|
count(count),
|
||||||
periods_in_transit(periods_in_transit),
|
periods_in_transit(periods_in_transit),
|
||||||
feeder_share(feeder_share),
|
feeder_share(feeder_share),
|
||||||
@ -73,7 +73,7 @@ CargoPacket::CargoPacket(uint16_t count, uint16_t periods_in_transit, StationID
|
|||||||
source_id(source_id),
|
source_id(source_id),
|
||||||
source_type(source_type),
|
source_type(source_type),
|
||||||
first_station(first_station),
|
first_station(first_station),
|
||||||
next_station(next_station)
|
next_hop(next_hop)
|
||||||
{
|
{
|
||||||
assert(count != 0);
|
assert(count != 0);
|
||||||
}
|
}
|
||||||
@ -88,7 +88,7 @@ CargoPacket *CargoPacket::Split(uint new_size)
|
|||||||
if (!CargoPacket::CanAllocateItem()) return nullptr;
|
if (!CargoPacket::CanAllocateItem()) return nullptr;
|
||||||
|
|
||||||
Money fs = this->GetFeederShare(new_size);
|
Money fs = this->GetFeederShare(new_size);
|
||||||
CargoPacket *cp_new = new CargoPacket(new_size, this->periods_in_transit, this->first_station, this->next_station, this->source_xy, fs, this->source_type, this->source_id);
|
CargoPacket *cp_new = new CargoPacket(new_size, this->periods_in_transit, this->first_station, this->next_hop, this->source_xy, fs, this->source_type, this->source_id);
|
||||||
this->feeder_share -= fs;
|
this->feeder_share -= fs;
|
||||||
this->count -= new_size;
|
this->count -= new_size;
|
||||||
return cp_new;
|
return cp_new;
|
||||||
@ -501,7 +501,7 @@ bool VehicleCargoList::Stage(bool accepted, StationID current_station, StationID
|
|||||||
share = payment->PayTransfer(cp, cp->count);
|
share = payment->PayTransfer(cp, cp->count);
|
||||||
cp->AddFeederShare(share);
|
cp->AddFeederShare(share);
|
||||||
this->feeder_share += share;
|
this->feeder_share += share;
|
||||||
cp->next_station = cargo_next;
|
cp->next_hop = cargo_next;
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
NOT_REACHED();
|
NOT_REACHED();
|
||||||
@ -564,7 +564,7 @@ uint VehicleCargoList::Reassign<VehicleCargoList::MTA_DELIVER, VehicleCargoList:
|
|||||||
sum -= cp_split->Count();
|
sum -= cp_split->Count();
|
||||||
this->packets.insert(it, cp_split);
|
this->packets.insert(it, cp_split);
|
||||||
}
|
}
|
||||||
cp->next_station = INVALID_STATION;
|
cp->next_hop = INVALID_STATION;
|
||||||
}
|
}
|
||||||
|
|
||||||
this->action_counts[MTA_DELIVER] -= max_move;
|
this->action_counts[MTA_DELIVER] -= max_move;
|
||||||
|
@ -49,7 +49,7 @@ private:
|
|||||||
SourceType source_type{SourceType::Industry}; ///< Type of \c source_id.
|
SourceType source_type{SourceType::Industry}; ///< Type of \c source_id.
|
||||||
|
|
||||||
StationID first_station{INVALID_STATION}; ///< The station where the cargo came from first.
|
StationID first_station{INVALID_STATION}; ///< The station where the cargo came from first.
|
||||||
StationID next_station{INVALID_STATION}; ///< Station where the cargo wants to go next.
|
StationID next_hop{INVALID_STATION}; ///< Station where the cargo wants to go next.
|
||||||
|
|
||||||
/** The CargoList caches, thus needs to know about it. */
|
/** The CargoList caches, thus needs to know about it. */
|
||||||
template <class Tinst, class Tcont> friend class CargoList;
|
template <class Tinst, class Tcont> friend class CargoList;
|
||||||
@ -74,11 +74,11 @@ public:
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Sets the station where the packet is supposed to go next.
|
* Sets the station where the packet is supposed to go next.
|
||||||
* @param next_station Next station the packet should go to.
|
* @param next_hop Next station the packet should go to.
|
||||||
*/
|
*/
|
||||||
void SetNextStation(StationID next_station)
|
void SetNextHop(StationID next_hop)
|
||||||
{
|
{
|
||||||
this->next_station = next_station;
|
this->next_hop = next_hop;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -172,9 +172,9 @@ public:
|
|||||||
* Gets the ID of station the cargo wants to go next.
|
* Gets the ID of station the cargo wants to go next.
|
||||||
* @return Next station for this packets.
|
* @return Next station for this packets.
|
||||||
*/
|
*/
|
||||||
inline StationID GetNextStation() const
|
inline StationID GetNextHop() const
|
||||||
{
|
{
|
||||||
return this->next_station;
|
return this->next_hop;
|
||||||
}
|
}
|
||||||
|
|
||||||
static void InvalidateAllFrom(SourceType src_type, SourceID src);
|
static void InvalidateAllFrom(SourceType src_type, SourceID src);
|
||||||
|
Loading…
Reference in New Issue
Block a user