summaryrefslogtreecommitdiff
path: root/src/newgrf_object.cpp
diff options
context:
space:
mode:
authorrubidium <rubidium@openttd.org>2010-08-28 17:38:07 +0000
committerrubidium <rubidium@openttd.org>2010-08-28 17:38:07 +0000
commit164a923c69ab96da81634294896a3d8065157251 (patch)
tree5f3bf37b5df348a26265e9cac341fa3910db2622 /src/newgrf_object.cpp
parent0a86eac2f1d8f646180cdd1d56f555e7956f7ebb (diff)
downloadopenttd-164a923c69ab96da81634294896a3d8065157251.tar.xz
(svn r20652) -Codechange: implement a function to get the index of a spec.
Diffstat (limited to 'src/newgrf_object.cpp')
-rw-r--r--src/newgrf_object.cpp5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/newgrf_object.cpp b/src/newgrf_object.cpp
index dc01d11d3..dc1ac84f8 100644
--- a/src/newgrf_object.cpp
+++ b/src/newgrf_object.cpp
@@ -46,6 +46,11 @@ bool ObjectSpec::IsAvailable() const
(flags & (_game_mode != GM_EDITOR ? OBJECT_FLAG_ONLY_IN_SCENEDIT : OBJECT_FLAG_ONLY_IN_GAME)) == 0;
}
+uint ObjectSpec::Index() const
+{
+ return this - _object_specs;
+}
+
/** This function initialize the spec arrays of objects. */
void ResetObjects()
{