Add function for whether OpenTTD is running headlessly

Always returns true for dedicated builds
Returns _network_dedicated otherwise
pull/642/head
Jonathan G Rennison 4 months ago
parent c871464285
commit f0ec7a7693

@ -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 */

Loading…
Cancel
Save