@@ -177,6 +177,47 @@ CScriptGameObject *get_object_by_id(u16 id)
177177 return pGameObject->lua_game_object ();
178178}
179179
180+ LPCSTR get_past_wdesc ()
181+ {
182+ return (g_pGamePersistent->Environment ().Current [0 ] ? g_pGamePersistent->Environment ().Current [0 ]->m_identifier .c_str () : " null" );
183+ }
184+
185+ LPCSTR get_next_wdesc ()
186+ {
187+ return (g_pGamePersistent->Environment ().Current [1 ] ? g_pGamePersistent->Environment ().Current [1 ]->m_identifier .c_str () : " null" );
188+ }
189+
190+ float get_past_wdesc_execution_time ()
191+ {
192+ return (g_pGamePersistent->Environment ().Current [0 ] ? g_pGamePersistent->Environment ().Current [0 ]->exec_time : -1 .f );
193+ }
194+
195+ float get_next_wdesc_execution_time ()
196+ {
197+ return (g_pGamePersistent->Environment ().Current [1 ] ? g_pGamePersistent->Environment ().Current [1 ]->exec_time : -1 .f );
198+ }
199+
200+ float get_weather_game_time ()
201+ {
202+ return (&g_pGamePersistent->Environment () ? g_pGamePersistent->Environment ().GetGameTime () : -1 .f );
203+ }
204+
205+ void set_past_wdesc (LPCSTR WeatherSection)
206+ {
207+ if (&g_pGamePersistent->Environment ())
208+ {
209+ g_pGamePersistent->Environment ().SetEnvDesc (WeatherSection, g_pGamePersistent->Environment ().Current [0 ]);
210+ }
211+ }
212+
213+ void set_next_wdesc (LPCSTR WeatherSection)
214+ {
215+ if (&g_pGamePersistent->Environment ())
216+ {
217+ g_pGamePersistent->Environment ().SetEnvDesc (WeatherSection, g_pGamePersistent->Environment ().Current [1 ]);
218+ }
219+ }
220+
180221LPCSTR get_weather ()
181222{
182223 return (*g_pGamePersistent->Environment ().GetWeather ());
@@ -960,6 +1001,13 @@ void CLevel::script_register(lua_State *L)
9601001 def (" get_weather" , get_weather),
9611002 def (" set_weather" , set_weather),
9621003 def (" set_weather_fx" , set_weather_fx),
1004+ def (" set_past_weather" , set_past_wdesc),
1005+ def (" set_next_weather" , set_next_wdesc),
1006+ def (" get_weather_game_time" , get_weather_game_time),
1007+ def (" get_past_wdesc_execution_time" , get_past_wdesc_execution_time),
1008+ def (" get_next_wdesc_execution_time" , get_next_wdesc_execution_time),
1009+ def (" get_past_weather" , get_past_wdesc),
1010+ def (" get_next_weather" , get_next_wdesc),
9631011 def (" start_weather_fx_from_time" , start_weather_fx_from_time),
9641012 def (" is_wfx_playing" , is_wfx_playing),
9651013 def (" get_wfx_time" , get_wfx_time),
0 commit comments