Add function for whether OpenTTD is running headlessly
Always returns true for dedicated builds Returns _network_dedicated otherwise
This commit is contained in:
10
src/stdafx.h
10
src/stdafx.h
@@ -546,4 +546,14 @@ inline void free(const void *ptr)
|
|||||||
|
|
||||||
#define SINGLE_ARG(...) __VA_ARGS__
|
#define SINGLE_ARG(...) __VA_ARGS__
|
||||||
|
|
||||||
|
#if defined(DEDICATED)
|
||||||
|
inline constexpr bool IsHeadless() { return true; }
|
||||||
|
#else
|
||||||
|
inline bool IsHeadless()
|
||||||
|
{
|
||||||
|
extern bool _network_dedicated;
|
||||||
|
return _network_dedicated;
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
#endif /* STDAFX_H */
|
#endif /* STDAFX_H */
|
||||||
|
Reference in New Issue
Block a user