added game mode reader

develop
doomchild 2011-03-01 14:38:45 -06:00
parent bdb0ebd8ea
commit 0b77744905
2 changed files with 13 additions and 1 deletions

@ -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_ReadCurrentWeather(DFHackObject* world, uint8_t* weather);
DFHACK_EXPORT int World_WriteCurrentWeather(DFHackObject* world, uint8_t weather); DFHACK_EXPORT int World_WriteCurrentWeather(DFHackObject* world, uint8_t weather);
DFHACK_EXPORT int World_ReadGameMode(DFHackObject* world);
#ifdef __cplusplus #ifdef __cplusplus
} }
#endif #endif

@ -113,7 +113,7 @@ int World_ReadCurrentWeather(DFHackObject* world, uint8_t* weather)
int World_WriteCurrentWeather(DFHackObject* world, uint8_t weather) int World_WriteCurrentWeather(DFHackObject* world, uint8_t weather)
{ {
if (world != NULL) if(world != NULL)
{ {
((DFHack::World*)world)->SetCurrentWeather(weather); ((DFHack::World*)world)->SetCurrentWeather(weather);
return 1; return 1;
@ -122,6 +122,16 @@ int World_WriteCurrentWeather(DFHackObject* world, uint8_t weather)
return -1; return -1;
} }
int World_ReadGameMode(DFHackObject* world)
{
if(world != NULL)
{
return ((DFHack::World*)world)->ReadGameMode();
}
return -1;
}
#ifdef __cplusplus #ifdef __cplusplus
} }
#endif #endif