Add function for whether OpenTTD is running headlessly

Always returns true for dedicated builds
Returns _network_dedicated otherwise
This commit is contained in:
Jonathan G Rennison
2024-01-24 23:17:23 +00:00
parent c871464285
commit f0ec7a7693

View File

@@ -546,4 +546,14 @@ inline void free(const void *ptr)
#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 */