Skip to content

Commit 4398a0e

Browse files
authored
Merge pull request #204 from emre1702/Fix_getWeather_after_blend_#5204
#5204 - Fix Weather blending at server
2 parents bf22895 + 05e2d21 commit 4398a0e

File tree

3 files changed

+9
-6
lines changed

3 files changed

+9
-6
lines changed

Server/mods/deathmatch/logic/CBlendedWeather.cpp

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,11 @@ CBlendedWeather::CBlendedWeather(CClock* pClock)
2525
m_pClock = pClock;
2626
}
2727

28+
void CBlendedWeather::DoPulse(void)
29+
{
30+
Update();
31+
}
32+
2833
void CBlendedWeather::SetWeather(unsigned char ucWeather)
2934
{
3035
// Set the primary and secondary weather instantly and stop any blending we might've been doing
@@ -36,9 +41,6 @@ void CBlendedWeather::SetWeather(unsigned char ucWeather)
3641

3742
void CBlendedWeather::SetWeatherBlended(unsigned char ucWeather, unsigned char ucHour)
3843
{
39-
// TODO: Should write it to not require this
40-
Update();
41-
4244
// Store the weather we blend to for the timing
4345
m_ucPrimaryBlendedWeather = m_ucSecondaryWeather;
4446
m_ucSecondaryBlendedWeather = ucWeather;
@@ -54,9 +56,6 @@ void CBlendedWeather::SetWeatherBlended(unsigned char ucWeather, unsigned char u
5456

5557
unsigned char CBlendedWeather::GetWeather(void)
5658
{
57-
// TODO: Should write it to not require this
58-
Update();
59-
6059
// If we're blending the weather, return the weather we started blending from
6160
if (m_ucBlendStopHour != 0xFF)
6261
{

Server/mods/deathmatch/logic/CBlendedWeather.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,8 @@ class CBlendedWeather
1818
public:
1919
CBlendedWeather(CClock* pClock);
2020

21+
void DoPulse(void);
22+
2123
void SetWeather(unsigned char ucWeather);
2224
void SetWeatherBlended(unsigned char ucWeather, unsigned char ucHour);
2325

Server/mods/deathmatch/logic/CGame.cpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -469,6 +469,8 @@ void CGame::DoPulse(void)
469469

470470
CLOCK_CALL1(m_pAsyncTaskScheduler->CollectResults());
471471

472+
CLOCK_CALL1(m_pMapManager->GetWeather()->DoPulse(););
473+
472474
PrintLogOutputFromNetModule();
473475
m_pScriptDebugging->UpdateLogOutput();
474476

0 commit comments

Comments
 (0)