Brimbane
Farmhand
I would need SMAPI code to check whether the player is outdoors or not.
To be more precise: I need code to abort/leave a function if it is detected that the player is indoors in general (houses, dungeons etc, anywhere but outside in the open).
Concrete example (from the "Wind Effects" mod):
To be more precise: I need code to abort/leave a function if it is detected that the player is indoors in general (houses, dungeons etc, anywhere but outside in the open).
Concrete example (from the "Wind Effects" mod):
Code:
public void Shake(IReflectionHelper helper, Vector2 tile)
{
// I guess here is where the outdoors check should be
(NEEDED CODE)
// already shaking
if (helper.GetField<float>(this.bush, "maxShake").GetValue() != 0)
return;
helper.GetField<bool>(this.bush, "shakeLeft").SetValue(this.left);
helper.GetField<float>(this.bush, "maxShake").SetValue((float)Math.PI / 128f);
}