From 9328afe65c72b29f5cedbf1897ea8559f6b2c42f Mon Sep 17 00:00:00 2001 From: Tiger Wang Date: Tue, 5 Jan 2021 02:13:02 +0000 Subject: Convert most calls to blocking GetHeight/GetBiomeAt to direct chunk accesses * Hopefully fixes #5094 --- src/World.h | 13 +++---------- 1 file changed, 3 insertions(+), 10 deletions(-) (limited to 'src/World.h') diff --git a/src/World.h b/src/World.h index b0ffc2b07..ba4e5ee58 100644 --- a/src/World.h +++ b/src/World.h @@ -999,10 +999,7 @@ public: bool IsWeatherSunny(void) const { return (m_Weather == wSunny); } /** Returns true if it is sunny at the specified location. This takes into account biomes. */ - bool IsWeatherSunnyAt(int a_BlockX, int a_BlockZ) - { - return (IsWeatherSunny() || IsBiomeNoDownfall(GetBiomeAt(a_BlockX, a_BlockZ))); - } + bool IsWeatherSunnyAt(int a_BlockX, int a_BlockZ) const; /** Returns true if the current weather is rainy. */ bool IsWeatherRain(void) const { return (m_Weather == wRain); } @@ -1027,15 +1024,11 @@ public: /** Returns true if it is raining or storming at the specified location. This takes into account biomes. */ - virtual bool IsWeatherWetAt(int a_BlockX, int a_BlockZ) override - { - auto Biome = GetBiomeAt(a_BlockX, a_BlockZ); - return (IsWeatherWet() && !IsBiomeNoDownfall(Biome) && !IsBiomeCold(Biome)); - } + virtual bool IsWeatherWetAt(int a_BlockX, int a_BlockZ) override; /** Returns true if it is raining or storming at the specified location, and the rain reaches (the bottom of) the specified block position. */ - virtual bool IsWeatherWetAtXYZ(Vector3i a_Pos) override; + virtual bool IsWeatherWetAtXYZ(Vector3i a_Position) override; /** Returns the seed of the world. */ int GetSeed(void) { return m_Generator.GetSeed(); } -- cgit v1.2.3