diff options
Diffstat (limited to 'src/newgrf_generic.h')
-rw-r--r-- | src/newgrf_generic.h | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/src/newgrf_generic.h b/src/newgrf_generic.h index ca245193e..c047a7b8b 100644 --- a/src/newgrf_generic.h +++ b/src/newgrf_generic.h @@ -51,6 +51,15 @@ void ResetGenericCallbacks(); void AddGenericCallback(uint8 feature, const GRFFile *file, const SpriteGroup *group); uint16 GetAiPurchaseCallbackResult(uint8 feature, CargoID cargo_type, uint8 default_selection, IndustryType src_industry, IndustryType dst_industry, uint8 distance, AIConstructionEvent event, uint8 count, uint8 station_size, const GRFFile **file); -void AmbientSoundEffectCallback(TileIndex tile); + +/** Play an ambient sound effect for an empty tile. */ +static inline void AmbientSoundEffect(TileIndex tile) +{ + /* Only run callback if enabled. */ + if (!HasGrfMiscBit(GMB_AMBIENT_SOUND_CALLBACK)) return; + + extern void AmbientSoundEffectCallback(TileIndex tile); + AmbientSoundEffectCallback(tile); +} #endif /* NEWGRF_GENERIC_H */ |