From 0abf14384c36dc980ec9441734246603de929633 Mon Sep 17 00:00:00 2001 From: belugas Date: Sat, 7 Feb 2009 02:38:32 +0000 Subject: (svn r15392) -Codechange: move the spec getter to a place where it's only required, without the use of extern --- src/unmovable_cmd.cpp | 14 ++++++++++++++ 1 file changed, 14 insertions(+) (limited to 'src/unmovable_cmd.cpp') diff --git a/src/unmovable_cmd.cpp b/src/unmovable_cmd.cpp index 508cdc1d5..c93f0180e 100644 --- a/src/unmovable_cmd.cpp +++ b/src/unmovable_cmd.cpp @@ -28,6 +28,20 @@ #include "table/sprites.h" #include "table/unmovable_land.h" +/** + * Accessor for array _original_unmovable. + * This will ensure at once : proper access and + * not allowing modifications of it. + * @param type of unmovable (which is the index in _original_unmovable) + * @pre type < UNMOVABLE_MAX + * @return a pointer to the corresponding unmovable spec + **/ +static inline const UnmovableSpec *GetUnmovableSpec(UnmovableType type) +{ + assert(type < UNMOVABLE_MAX); + return &_original_unmovable[type]; +} + /** Destroy a HQ. * During normal gameplay you can only implicitely destroy a HQ when you are * rebuilding it. Otherwise, only water can destroy it. -- cgit v1.2.3-54-g00ecf