Merge branch 'master' into jgrpp-nrt
Merge NRT feature # Conflicts: # docs/landscape.html # docs/landscape_grid.html # src/bridge_map.h # src/build_vehicle_gui.cpp # src/company_base.h # src/company_cmd.cpp # src/misc_gui.cpp # src/newgrf.cpp # src/newgrf_engine.cpp # src/pathfinder/follow_track.hpp # src/pathfinder/npf/npf.cpp # src/road_cmd.cpp # src/road_func.h # src/road_gui.cpp # src/road_map.h # src/road_type.h # src/roadveh_cmd.cpp # src/saveload/afterload.cpp # src/saveload/company_sl.cpp # src/script/api/script_bridge.cpp # src/table/newgrf_debug_data.h # src/tile_cmd.h # src/town_cmd.cpp # src/tunnel_map.h # src/tunnelbridge_cmd.cpp
This commit is contained in:
@@ -568,7 +568,7 @@ Company *DoStartupNewCompany(bool is_ai, CompanyID company = INVALID_COMPANY)
|
||||
c->share_owners[0] = c->share_owners[1] = c->share_owners[2] = c->share_owners[3] = INVALID_OWNER;
|
||||
|
||||
c->avail_railtypes = GetCompanyRailtypes(c->index);
|
||||
c->avail_roadtypes = GetCompanyRoadtypes(c->index);
|
||||
c->avail_roadtypes = GetCompanyRoadTypes(c->index);
|
||||
c->inaugurated_year = _cur_year;
|
||||
RandomCompanyManagerFaceBits(c->face, (GenderEthnicity)Random(), false, false); // create a random company manager face
|
||||
|
||||
@@ -1183,11 +1183,40 @@ int CompanyServiceInterval(const Company *c, VehicleType type)
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Get total sum of all owned road bits.
|
||||
* @return Combined total road road bits.
|
||||
*/
|
||||
uint32 CompanyInfrastructure::GetRoadTotal() const
|
||||
{
|
||||
uint32 total = 0;
|
||||
for (RoadType rt = ROADTYPE_BEGIN; rt != ROADTYPE_END; rt++) {
|
||||
if (RoadTypeIsRoad(rt)) total += this->road[rt];
|
||||
}
|
||||
return total;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get total sum of all owned tram bits.
|
||||
* @return Combined total of tram road bits.
|
||||
*/
|
||||
uint32 CompanyInfrastructure::GetTramTotal() const
|
||||
{
|
||||
uint32 total = 0;
|
||||
for (RoadType rt = ROADTYPE_BEGIN; rt != ROADTYPE_END; rt++) {
|
||||
if (RoadTypeIsTram(rt)) total += this->road[rt];
|
||||
}
|
||||
return total;
|
||||
}
|
||||
|
||||
char *CompanyInfrastructure::Dump(char *buffer, const char *last) const
|
||||
{
|
||||
for (RailType rt = RAILTYPE_BEGIN; rt != RAILTYPE_END; rt++) {
|
||||
if (rail[rt]) buffer += seprintf(buffer, last, "Rail: %s: %u\n", GetStringPtr(GetRailTypeInfo(rt)->strings.name), rail[rt]);
|
||||
}
|
||||
for (RoadType rt = ROADTYPE_BEGIN; rt != ROADTYPE_END; rt++) {
|
||||
if (road[rt]) buffer += seprintf(buffer, last, "%s: %s: %u\n", RoadTypeIsTram(rt) ? "Tram" : "Road", GetStringPtr(GetRoadTypeInfo(rt)->strings.name), road[rt]);
|
||||
}
|
||||
buffer += seprintf(buffer, last, "Signal: %u\n", signal);
|
||||
buffer += seprintf(buffer, last, "Road: %u\n", road[ROADTYPE_ROAD]);
|
||||
buffer += seprintf(buffer, last, "Tram: %u\n", road[ROADTYPE_TRAM]);
|
||||
|
Reference in New Issue
Block a user