mirror of
https://github.com/TrinityCore/TrinityCore.git
synced 2026-01-16 07:30:42 +01:00
Core/Conditions: implement CONDITION_GAMEMASTER (#23108)
This commit is contained in:
committed by
Giacomo Pozzoni
parent
a926a3088d
commit
262ddaf819
@@ -499,6 +499,17 @@ bool Condition::Meets(ConditionSourceInfo& sourceInfo) const
|
||||
}
|
||||
break;
|
||||
}
|
||||
case CONDITION_GAMEMASTER:
|
||||
{
|
||||
if (Player* player = object->ToPlayer())
|
||||
{
|
||||
if (ConditionValue1 == 1)
|
||||
condMeets = player->CanBeGameMaster();
|
||||
else
|
||||
condMeets = player->IsGameMaster();
|
||||
}
|
||||
break;
|
||||
}
|
||||
default:
|
||||
condMeets = false;
|
||||
break;
|
||||
@@ -686,6 +697,9 @@ uint32 Condition::GetSearcherTypeMaskForCondition() const
|
||||
case CONDITION_QUESTSTATE:
|
||||
mask |= GRID_MAP_TYPE_MASK_PLAYER;
|
||||
break;
|
||||
case CONDITION_GAMEMASTER:
|
||||
mask |= GRID_MAP_TYPE_MASK_PLAYER;
|
||||
break;
|
||||
default:
|
||||
ASSERT(false && "Condition::GetSearcherTypeMaskForCondition - missing condition handling!");
|
||||
break;
|
||||
@@ -2259,6 +2273,7 @@ bool ConditionMgr::isConditionTypeValid(Condition* cond) const
|
||||
case CONDITION_IN_WATER:
|
||||
case CONDITION_CHARMED:
|
||||
case CONDITION_TAXI:
|
||||
case CONDITION_GAMEMASTER:
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
||||
@@ -82,7 +82,8 @@ enum ConditionTypes
|
||||
CONDITION_PET_TYPE = 45, // mask 0 0 true if player has a pet of given type(s)
|
||||
CONDITION_TAXI = 46, // 0 0 0 true if player is on taxi
|
||||
CONDITION_QUESTSTATE = 47, // quest_id state_mask 0 true if player is in any of the provided quest states for the quest (1 = not taken, 2 = completed, 8 = in progress, 32 = failed, 64 = rewarded)
|
||||
CONDITION_MAX = 48 // MAX
|
||||
CONDITION_GAMEMASTER = 48, // canBeGM 0 0 true if player is gamemaster (or can be gamemaster)
|
||||
CONDITION_MAX = 49 // MAX
|
||||
};
|
||||
|
||||
/*! Documentation on implementing a new ConditionSourceType:
|
||||
|
||||
Reference in New Issue
Block a user