mirror of https://github.com/OpenTTD/OpenTTD
(svn r15392) -Codechange: move the spec getter to a place where it's only required, without the use of extern
parent
bab7367a59
commit
0abf14384c
|
@ -21,11 +21,5 @@ struct UnmovableSpec {
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
extern const UnmovableSpec _original_unmovable[];
|
|
||||||
|
|
||||||
static inline const UnmovableSpec *GetUnmovableSpec(UnmovableType type)
|
|
||||||
{
|
|
||||||
return &_original_unmovable[type];
|
|
||||||
}
|
|
||||||
|
|
||||||
#endif /* UNMOVABLE_H */
|
#endif /* UNMOVABLE_H */
|
||||||
|
|
|
@ -28,6 +28,20 @@
|
||||||
#include "table/sprites.h"
|
#include "table/sprites.h"
|
||||||
#include "table/unmovable_land.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.
|
/** Destroy a HQ.
|
||||||
* During normal gameplay you can only implicitely destroy a HQ when you are
|
* During normal gameplay you can only implicitely destroy a HQ when you are
|
||||||
* rebuilding it. Otherwise, only water can destroy it.
|
* rebuilding it. Otherwise, only water can destroy it.
|
||||||
|
|
|
@ -15,6 +15,7 @@ enum UnmovableType {
|
||||||
UNMOVABLE_STATUE = 2, ///< Statue in towns
|
UNMOVABLE_STATUE = 2, ///< Statue in towns
|
||||||
UNMOVABLE_OWNED_LAND = 3, ///< Owned land 'flag'
|
UNMOVABLE_OWNED_LAND = 3, ///< Owned land 'flag'
|
||||||
UNMOVABLE_HQ = 4, ///< HeadQuarter of a player
|
UNMOVABLE_HQ = 4, ///< HeadQuarter of a player
|
||||||
|
UNMOVABLE_MAX,
|
||||||
};
|
};
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
Loading…
Reference in New Issue