Core/Conditions: Implemented missing PlayerCondition columns - time and weather
Port From (https://github.com/TrinityCore/TrinityCore/commit/8aaf750be1ee16a299016cf038bd84bd9b387544)
This commit is contained in:
@@ -2043,7 +2043,14 @@ namespace Game
|
||||
return false;
|
||||
}
|
||||
|
||||
// TODO: time condition
|
||||
if (condition.Time[0] != 0)
|
||||
{
|
||||
var from = Time.GetUnixTimeFromPackedTime(condition.Time[0]);
|
||||
var to = Time.GetUnixTimeFromPackedTime(condition.Time[1]);
|
||||
|
||||
if (GameTime.GetGameTime() < from || GameTime.GetGameTime() > to)
|
||||
return false;
|
||||
}
|
||||
|
||||
if (condition.WorldStateExpressionID != 0)
|
||||
{
|
||||
@@ -2055,7 +2062,9 @@ namespace Game
|
||||
return false;
|
||||
}
|
||||
|
||||
// TODO: weather condition
|
||||
if (condition.WeatherID != 0)
|
||||
if (player.GetMap().GetZoneWeather(player.GetZoneId()) != (WeatherState)condition.WeatherID)
|
||||
return false;
|
||||
|
||||
if (condition.Achievement[0] != 0)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user