From 0b777449059348238b4b434fb2fd4e66695df5f8 Mon Sep 17 00:00:00 2001 From: doomchild Date: Tue, 1 Mar 2011 14:38:45 -0600 Subject: [PATCH] added game mode reader --- library/include/dfhack-c/modules/World_C.h | 2 ++ library/modules/World_C.cpp | 12 +++++++++++- 2 files changed, 13 insertions(+), 1 deletion(-) 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