Codechange: Replace HasVehicleOnPos and callbacks with HasVehicleOnTile and lambda-predicates.
This commit is contained in:
@@ -544,21 +544,6 @@ void FindVehicleOnPos(TileIndex tile, void *data, VehicleFromPosProc *proc)
|
||||
VehicleFromPos(tile, data, proc, false);
|
||||
}
|
||||
|
||||
/**
|
||||
* Checks whether a vehicle is on a specific location. It will call \a proc for
|
||||
* vehicles until it returns non-nullptr.
|
||||
* @note Use #FindVehicleOnPos when you have the intention that all vehicles
|
||||
* should be iterated over.
|
||||
* @param tile The location on the map
|
||||
* @param data Arbitrary data passed to \a proc.
|
||||
* @param proc The \a proc that determines whether a vehicle will be "found".
|
||||
* @return True if proc returned non-nullptr.
|
||||
*/
|
||||
bool HasVehicleOnPos(TileIndex tile, void *data, VehicleFromPosProc *proc)
|
||||
{
|
||||
return VehicleFromPos(tile, data, proc, true) != nullptr;
|
||||
}
|
||||
|
||||
/**
|
||||
* Callback that returns 'real' vehicles lower or at height \c *(int*)data .
|
||||
* @param v Vehicle to examine.
|
||||
|
||||
Reference in New Issue
Block a user