Jump to content

forageSystem.getWeatherType may not work as intended


Tykvesh

Recommended Posts

According to ClimateManager, precipitationIntensity is used both for snow and rain, which makes sense.

This forageSystem function will return "isRaining" during snow, because it tests for any precipitation.

I have not 100% confirmed it, but figured it was worth mentioning.

 

function forageSystem.getWeatherType()
	if getClimateManager():getPrecipitationIntensity() > 0 then return "isRaining"; end;
	if getPuddlesManager():getPuddlesSize() > 0.1 then return "hasRained"; end;
	if getClimateManager():getSnowStrength() > 0 then return "isSnowing"; end;
	return "isNormal";
end

 

public float getPrecipitationIntensity() {
	return this.precipitationIntensity.finalValue;
}

public boolean isRaining() {
	return this.getPrecipitationIntensity() > 0.0f && !this.getPrecipitationIsSnow();
}

public float getRainIntensity() {
	return this.isRaining() ? this.getPrecipitationIntensity() : 0.0f;
}

public boolean isSnowing() {
	return this.getPrecipitationIntensity() > 0.0f && this.getPrecipitationIsSnow();
}

public float getSnowIntensity() {
	return this.isSnowing() ? this.getPrecipitationIntensity() : 0.0f;
}
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...