Some refactoring of code. and some cleanups
This commit is contained in:
@@ -91,11 +91,11 @@ namespace Game.Conditions
|
||||
break;
|
||||
case ConditionTypes.Class:
|
||||
if (unit != null)
|
||||
condMeets = Convert.ToBoolean(unit.getClassMask() & ConditionValue1);
|
||||
condMeets = Convert.ToBoolean(unit.GetClassMask() & ConditionValue1);
|
||||
break;
|
||||
case ConditionTypes.Race:
|
||||
if (unit != null)
|
||||
condMeets = Convert.ToBoolean(unit.getRaceMask() & ConditionValue1);
|
||||
condMeets = Convert.ToBoolean(unit.GetRaceMask() & ConditionValue1);
|
||||
break;
|
||||
case ConditionTypes.Gender:
|
||||
if (player != null)
|
||||
@@ -169,7 +169,7 @@ namespace Game.Conditions
|
||||
break;
|
||||
case ConditionTypes.Level:
|
||||
if (unit != null)
|
||||
condMeets = MathFunctions.CompareValues((ComparisionType)ConditionValue2, unit.getLevel(), ConditionValue1);
|
||||
condMeets = MathFunctions.CompareValues((ComparisionType)ConditionValue2, unit.GetLevel(), ConditionValue1);
|
||||
break;
|
||||
case ConditionTypes.DrunkenState:
|
||||
if (player != null)
|
||||
@@ -201,7 +201,7 @@ namespace Game.Conditions
|
||||
}
|
||||
break;
|
||||
case ConditionTypes.TypeMask:
|
||||
condMeets = Convert.ToBoolean((TypeMask)ConditionValue1 & obj.objectTypeMask);
|
||||
condMeets = Convert.ToBoolean((TypeMask)ConditionValue1 & obj.ObjectTypeMask);
|
||||
break;
|
||||
case ConditionTypes.RelationTo:
|
||||
{
|
||||
@@ -332,7 +332,7 @@ namespace Game.Conditions
|
||||
{
|
||||
Pet pet = player.GetPet();
|
||||
if (pet)
|
||||
condMeets = (((1 << (int)pet.getPetType()) & ConditionValue1) != 0);
|
||||
condMeets = (((1 << (int)pet.GetPetType()) & ConditionValue1) != 0);
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
||||
@@ -25,7 +25,6 @@ using Game.Loots;
|
||||
using Game.Spells;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using Framework.IO;
|
||||
|
||||
namespace Game
|
||||
@@ -1677,16 +1676,16 @@ namespace Game
|
||||
|
||||
public static bool IsPlayerMeetingCondition(Player player, PlayerConditionRecord condition)
|
||||
{
|
||||
if (condition.MinLevel != 0 && player.getLevel() < condition.MinLevel)
|
||||
if (condition.MinLevel != 0 && player.GetLevel() < condition.MinLevel)
|
||||
return false;
|
||||
|
||||
if (condition.MaxLevel != 0 && player.getLevel() > condition.MaxLevel)
|
||||
if (condition.MaxLevel != 0 && player.GetLevel() > condition.MaxLevel)
|
||||
return false;
|
||||
|
||||
if (condition.RaceMask != 0 && !Convert.ToBoolean(player.getRaceMask() & condition.RaceMask))
|
||||
if (condition.RaceMask != 0 && !Convert.ToBoolean(player.GetRaceMask() & condition.RaceMask))
|
||||
return false;
|
||||
|
||||
if (condition.ClassMask != 0 && !Convert.ToBoolean(player.getClassMask() & condition.ClassMask))
|
||||
if (condition.ClassMask != 0 && !Convert.ToBoolean(player.GetClassMask() & condition.ClassMask))
|
||||
return false;
|
||||
|
||||
if (condition.Gender >= 0 && (int)player.GetGender() != condition.Gender)
|
||||
|
||||
Reference in New Issue
Block a user