Fix extra aspects variable not being set for newly generated maps
This commit is contained in:
@@ -34,6 +34,7 @@
|
|||||||
#include "string_func.h"
|
#include "string_func.h"
|
||||||
#include "thread.h"
|
#include "thread.h"
|
||||||
#include "tgp.h"
|
#include "tgp.h"
|
||||||
|
#include "signal_func.h"
|
||||||
|
|
||||||
#include "safeguards.h"
|
#include "safeguards.h"
|
||||||
|
|
||||||
@@ -312,6 +313,7 @@ void GenerateWorld(GenWorldMode mode, uint size_x, uint size_y, bool reset_setti
|
|||||||
|
|
||||||
/* Load the right landscape stuff, and the NewGRFs! */
|
/* Load the right landscape stuff, and the NewGRFs! */
|
||||||
GfxLoadSprites();
|
GfxLoadSprites();
|
||||||
|
InitialiseExtraAspectsVariable();
|
||||||
LoadStringWidthTable();
|
LoadStringWidthTable();
|
||||||
|
|
||||||
/* Re-init the windowing system */
|
/* Re-init the windowing system */
|
||||||
|
@@ -1467,7 +1467,7 @@ void UpdateAllSignalAspects()
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void UpdateExtraAspectsVariable()
|
static uint8 DetermineExtraAspectsVariable()
|
||||||
{
|
{
|
||||||
uint8 new_extra_aspects = 0;
|
uint8 new_extra_aspects = 0;
|
||||||
|
|
||||||
@@ -1481,6 +1481,12 @@ void UpdateExtraAspectsVariable()
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
return new_extra_aspects;
|
||||||
|
}
|
||||||
|
|
||||||
|
void UpdateExtraAspectsVariable()
|
||||||
|
{
|
||||||
|
uint8 new_extra_aspects = DetermineExtraAspectsVariable();
|
||||||
|
|
||||||
if (new_extra_aspects != _extra_aspects) {
|
if (new_extra_aspects != _extra_aspects) {
|
||||||
_extra_aspects = new_extra_aspects;
|
_extra_aspects = new_extra_aspects;
|
||||||
@@ -1488,3 +1494,8 @@ void UpdateExtraAspectsVariable()
|
|||||||
MarkWholeScreenDirty();
|
MarkWholeScreenDirty();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void InitialiseExtraAspectsVariable()
|
||||||
|
{
|
||||||
|
_extra_aspects = DetermineExtraAspectsVariable();
|
||||||
|
}
|
||||||
|
@@ -176,6 +176,7 @@ void UpdateAspectDeferred(TileIndex tile, Trackdir trackdir);
|
|||||||
void FlushDeferredAspectUpdates();
|
void FlushDeferredAspectUpdates();
|
||||||
void UpdateAllSignalAspects();
|
void UpdateAllSignalAspects();
|
||||||
void UpdateExtraAspectsVariable();
|
void UpdateExtraAspectsVariable();
|
||||||
|
void InitialiseExtraAspectsVariable();
|
||||||
|
|
||||||
inline uint8 GetForwardAspectFollowingTrackAndIncrement(TileIndex tile, Trackdir trackdir)
|
inline uint8 GetForwardAspectFollowingTrackAndIncrement(TileIndex tile, Trackdir trackdir)
|
||||||
{
|
{
|
||||||
|
Reference in New Issue
Block a user