Merge branch 'master' into jgrpp

# Conflicts:
#	src/bridge_map.h
#	src/crashlog.cpp
#	src/industry.h
#	src/linkgraph/linkgraph_type.h
#	src/order_type.h
#	src/saveload/afterload.cpp
#	src/settings.cpp
#	src/settings_type.h
#	src/smallmap_gui.cpp
#	src/spritecache.cpp
#	src/stdafx.h
#	src/table/settings.h.preamble
#	src/train.h
#	src/vehicle.cpp
#	src/viewport.cpp
#	src/viewport_func.h
#	src/widgets/station_widget.h
#	src/zoom_func.h
#	src/zoom_type.h
This commit is contained in:
Jonathan G Rennison
2019-07-08 16:19:07 +01:00
136 changed files with 706 additions and 501 deletions

View File

@@ -638,6 +638,7 @@ void SQGSWindow_Register(Squirrel *engine)
SQGSWindow.DefSQConst(engine, ScriptWindow::WID_A_WEBSITE, "WID_A_WEBSITE");
SQGSWindow.DefSQConst(engine, ScriptWindow::WID_QS_CAPTION, "WID_QS_CAPTION");
SQGSWindow.DefSQConst(engine, ScriptWindow::WID_QS_TEXT, "WID_QS_TEXT");
SQGSWindow.DefSQConst(engine, ScriptWindow::WID_QS_WARNING, "WID_QS_WARNING");
SQGSWindow.DefSQConst(engine, ScriptWindow::WID_QS_DEFAULT, "WID_QS_DEFAULT");
SQGSWindow.DefSQConst(engine, ScriptWindow::WID_QS_CANCEL, "WID_QS_CANCEL");
SQGSWindow.DefSQConst(engine, ScriptWindow::WID_QS_OK, "WID_QS_OK");
@@ -782,6 +783,7 @@ void SQGSWindow_Register(Squirrel *engine)
SQGSWindow.DefSQConst(engine, ScriptWindow::WID_NCP_LABEL, "WID_NCP_LABEL");
SQGSWindow.DefSQConst(engine, ScriptWindow::WID_NCP_PASSWORD, "WID_NCP_PASSWORD");
SQGSWindow.DefSQConst(engine, ScriptWindow::WID_NCP_SAVE_AS_DEFAULT_PASSWORD, "WID_NCP_SAVE_AS_DEFAULT_PASSWORD");
SQGSWindow.DefSQConst(engine, ScriptWindow::WID_NCP_WARNING, "WID_NCP_WARNING");
SQGSWindow.DefSQConst(engine, ScriptWindow::WID_NCP_CANCEL, "WID_NCP_CANCEL");
SQGSWindow.DefSQConst(engine, ScriptWindow::WID_NCP_OK, "WID_NCP_OK");
SQGSWindow.DefSQConst(engine, ScriptWindow::WID_NGRFI_CAPTION, "WID_NGRFI_CAPTION");
@@ -1118,6 +1120,7 @@ void SQGSWindow_Register(Squirrel *engine)
SQGSWindow.DefSQConst(engine, ScriptWindow::WID_SV_ROADVEHS, "WID_SV_ROADVEHS");
SQGSWindow.DefSQConst(engine, ScriptWindow::WID_SV_SHIPS, "WID_SV_SHIPS");
SQGSWindow.DefSQConst(engine, ScriptWindow::WID_SV_PLANES, "WID_SV_PLANES");
SQGSWindow.DefSQConst(engine, ScriptWindow::WID_SV_CATCHMENT, "WID_SV_CATCHMENT");
SQGSWindow.DefSQConst(engine, ScriptWindow::WID_STL_CAPTION, "WID_STL_CAPTION");
SQGSWindow.DefSQConst(engine, ScriptWindow::WID_STL_LIST, "WID_STL_LIST");
SQGSWindow.DefSQConst(engine, ScriptWindow::WID_STL_SCROLLBAR, "WID_STL_SCROLLBAR");
@@ -1262,6 +1265,7 @@ void SQGSWindow_Register(Squirrel *engine)
SQGSWindow.DefSQConst(engine, ScriptWindow::WID_TV_CENTER_VIEW, "WID_TV_CENTER_VIEW");
SQGSWindow.DefSQConst(engine, ScriptWindow::WID_TV_SHOW_AUTHORITY, "WID_TV_SHOW_AUTHORITY");
SQGSWindow.DefSQConst(engine, ScriptWindow::WID_TV_CHANGE_NAME, "WID_TV_CHANGE_NAME");
SQGSWindow.DefSQConst(engine, ScriptWindow::WID_TV_CATCHMENT, "WID_TV_CATCHMENT");
SQGSWindow.DefSQConst(engine, ScriptWindow::WID_TV_EXPAND, "WID_TV_EXPAND");
SQGSWindow.DefSQConst(engine, ScriptWindow::WID_TV_DELETE, "WID_TV_DELETE");
SQGSWindow.DefSQConst(engine, ScriptWindow::WID_TF_NEW_TOWN, "WID_TF_NEW_TOWN");

View File

@@ -20,7 +20,7 @@
/* static */ int32 ScriptCargoMonitor::GetTownDeliveryAmount(ScriptCompany::CompanyID company, CargoID cargo, TownID town_id, bool keep_monitoring)
{
CompanyID cid = static_cast<CompanyID>(company);
if (cid < OWNER_BEGIN || cid >= MAX_COMPANIES) return -1;
if (cid >= MAX_COMPANIES) return -1;
if (!ScriptCargo::IsValidCargo(cargo)) return -1;
if (!::Town::IsValidID(town_id)) return -1;
@@ -31,7 +31,7 @@
/* static */ int32 ScriptCargoMonitor::GetIndustryDeliveryAmount(ScriptCompany::CompanyID company, CargoID cargo, IndustryID industry_id, bool keep_monitoring)
{
CompanyID cid = static_cast<CompanyID>(company);
if (cid < OWNER_BEGIN || cid >= MAX_COMPANIES) return -1;
if (cid >= MAX_COMPANIES) return -1;
if (!ScriptCargo::IsValidCargo(cargo)) return -1;
if (!::Industry::IsValidID(industry_id)) return -1;
@@ -42,7 +42,7 @@
/* static */ int32 ScriptCargoMonitor::GetTownPickupAmount(ScriptCompany::CompanyID company, CargoID cargo, TownID town_id, bool keep_monitoring)
{
CompanyID cid = static_cast<CompanyID>(company);
if (cid < OWNER_BEGIN || cid >= MAX_COMPANIES) return -1;
if (cid >= MAX_COMPANIES) return -1;
if (!ScriptCargo::IsValidCargo(cargo)) return -1;
if (!::Town::IsValidID(town_id)) return -1;
@@ -53,7 +53,7 @@
/* static */ int32 ScriptCargoMonitor::GetIndustryPickupAmount(ScriptCompany::CompanyID company, CargoID cargo, IndustryID industry_id, bool keep_monitoring)
{
CompanyID cid = static_cast<CompanyID>(company);
if (cid < OWNER_BEGIN || cid >= MAX_COMPANIES) return -1;
if (cid >= MAX_COMPANIES) return -1;
if (!ScriptCargo::IsValidCargo(cargo)) return -1;
if (!::Industry::IsValidID(industry_id)) return -1;

View File

@@ -68,7 +68,7 @@
/* static */ bool ScriptRail::IsRailTypeAvailable(RailType rail_type)
{
if ((::RailType)rail_type < RAILTYPE_BEGIN || (::RailType)rail_type >= RAILTYPE_END) return false;
if ((::RailType)rail_type >= RAILTYPE_END) return false;
return ScriptObject::GetCompany() == OWNER_DEITY || ::HasRailtypeAvail(ScriptObject::GetCompany(), (::RailType)rail_type);
}

View File

@@ -1622,6 +1622,7 @@ public:
enum QueryStringWidgets {
WID_QS_CAPTION = ::WID_QS_CAPTION, ///< Caption of the window.
WID_QS_TEXT = ::WID_QS_TEXT, ///< Text of the query.
WID_QS_WARNING = ::WID_QS_WARNING, ///< Warning label about password security
WID_QS_DEFAULT = ::WID_QS_DEFAULT, ///< Default button.
WID_QS_CANCEL = ::WID_QS_CANCEL, ///< Cancel button.
WID_QS_OK = ::WID_QS_OK, ///< OK button.
@@ -1841,6 +1842,7 @@ public:
WID_NCP_LABEL = ::WID_NCP_LABEL, ///< Label in front of the password field.
WID_NCP_PASSWORD = ::WID_NCP_PASSWORD, ///< Input field for the password.
WID_NCP_SAVE_AS_DEFAULT_PASSWORD = ::WID_NCP_SAVE_AS_DEFAULT_PASSWORD, ///< Toggle 'button' for saving the current password as default password.
WID_NCP_WARNING = ::WID_NCP_WARNING, ///< Warning text about password security
WID_NCP_CANCEL = ::WID_NCP_CANCEL, ///< Close the window without changing anything.
WID_NCP_OK = ::WID_NCP_OK, ///< Safe the password etc.
};
@@ -2328,6 +2330,7 @@ public:
WID_SV_ROADVEHS = ::WID_SV_ROADVEHS, ///< List of scheduled road vehs button.
WID_SV_SHIPS = ::WID_SV_SHIPS, ///< List of scheduled ships button.
WID_SV_PLANES = ::WID_SV_PLANES, ///< List of scheduled planes button.
WID_SV_CATCHMENT = ::WID_SV_CATCHMENT, ///< Toggle catchment area highlight.
};
/** Widgets of the #CompanyStationsWindow class. */
@@ -2539,6 +2542,7 @@ public:
WID_TV_CENTER_VIEW = ::WID_TV_CENTER_VIEW, ///< Center the main view on this town.
WID_TV_SHOW_AUTHORITY = ::WID_TV_SHOW_AUTHORITY, ///< Show the town authority window.
WID_TV_CHANGE_NAME = ::WID_TV_CHANGE_NAME, ///< Change the name of this town.
WID_TV_CATCHMENT = ::WID_TV_CATCHMENT, ///< Toggle catchment area highlight.
WID_TV_EXPAND = ::WID_TV_EXPAND, ///< Expand this town (scenario editor only).
WID_TV_DELETE = ::WID_TV_DELETE, ///< Delete this town (scenario editor only).
};