diff --git a/library/include/dfhack-c/modules/World_C.h b/library/include/dfhack-c/modules/World_C.h index c4348b5e9..a16068d49 100644 --- a/library/include/dfhack-c/modules/World_C.h +++ b/library/include/dfhack-c/modules/World_C.h @@ -43,6 +43,8 @@ DFHACK_EXPORT int World_ReadCurrentDay(DFHackObject* world, uint32_t* day); DFHACK_EXPORT int World_ReadCurrentWeather(DFHackObject* world, uint8_t* weather); DFHACK_EXPORT int World_WriteCurrentWeather(DFHackObject* world, uint8_t weather); +DFHACK_EXPORT int World_ReadGameMode(DFHackObject* world); + #ifdef __cplusplus } #endif diff --git a/library/modules/World_C.cpp b/library/modules/World_C.cpp index 6aa0b320f..aa92a0359 100644 --- a/library/modules/World_C.cpp +++ b/library/modules/World_C.cpp @@ -113,7 +113,7 @@ int World_ReadCurrentWeather(DFHackObject* world, uint8_t* weather) int World_WriteCurrentWeather(DFHackObject* world, uint8_t weather) { - if (world != NULL) + if(world != NULL) { ((DFHack::World*)world)->SetCurrentWeather(weather); return 1; @@ -122,6 +122,16 @@ int World_WriteCurrentWeather(DFHackObject* world, uint8_t weather) return -1; } +int World_ReadGameMode(DFHackObject* world) +{ + if(world != NULL) + { + return ((DFHack::World*)world)->ReadGameMode(); + } + + return -1; +} + #ifdef __cplusplus } #endif