summaryrefslogtreecommitdiff
path: root/src/group_cmd.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/group_cmd.cpp')
-rw-r--r--src/group_cmd.cpp8
1 files changed, 8 insertions, 0 deletions
diff --git a/src/group_cmd.cpp b/src/group_cmd.cpp
index ba68515fd..cfa6a3fb5 100644
--- a/src/group_cmd.cpp
+++ b/src/group_cmd.cpp
@@ -409,6 +409,14 @@ void UpdateTrainGroupID(Train *v)
SetWindowDirty(WC_REPLACE_VEHICLE, VEH_TRAIN);
}
+/**
+ * Get the number of engines with EngineID id_e in the group with GroupID
+ * id_g
+ * @param company The company the group belongs to
+ * @param id_g The GroupID of the group used
+ * @param id_e The EngineID of the engine to count
+ * @return The number of engines with EngineID id_e in the group
+ */
uint GetGroupNumEngines(CompanyID company, GroupID id_g, EngineID id_e)
{
if (Group::IsValidID(id_g)) return Group::Get(id_g)->num_engines[id_e];