New feature: localized weather adds more weather types, different weather can happen in different sectors at the same time.

For more info, see http://thepit.ja-galaxy-forum.com/index.php?t=msg&th=23094&#msg_345949

Requires GameDir >= r2325

git-svn-id: https://ja2svn.mooo.com/source/ja2/trunk/GameSource/ja2_v1.13/Build@8253 3b4a5df2-a311-0410-b5c6-a8a6f20db521
This commit is contained in:
Flugente
2016-06-18 20:57:03 +00:00
parent facadda6e8
commit 503523a9fa
40 changed files with 1059 additions and 522 deletions
+8 -11
View File
@@ -5,22 +5,19 @@
static int LuaGetRainVal( lua_State *L )
{
lua_pushinteger( L, guiEnvWeather);
lua_pushinteger( L, GetWeatherInCurrentSector() );
return 1;
}
static int LuaSetRainVal( lua_State *L )
{
int newrain = luaL_checkinteger( L, 3);
luaL_argcheck( L, newrain >= 0 && newrain <= 2, 2, "The rain must be between 0 and 2" );
if (newrain == 0)
{
EnvEndRainStorm();
}
else
{
EnvBeginRainStorm( (UINT8)(newrain-1));
}
int newweather = luaL_checkinteger( L, 3);
int sector = luaL_checkinteger( L, 4 );
luaL_argcheck( L, newweather >= 0 && newweather < WEATHER_FORECAST_MAX, 2, "The rain must be between 0 and 5" );
luaL_argcheck( L, sector >= 0 && sector <= 255, 2, "The secor must be between 0 and 255" );
ChangeWeather( sector, newweather );
return 0;
}