PDA

Просмотр полной версии : [9459][fix] Penance - Interrupt


idk
11.03.2010, 23:12
Принятый патч.


diff --git a/src/game/ObjectMgr.cpp b/src/game/ObjectMgr.cpp
index b887961..f8b041d 100644
--- a/src/game/ObjectMgr.cpp
+++ b/src/game/ObjectMgr.cpp
@@ -7389,6 +7389,8 @@ bool PlayerCondition::Meets(Player const * player) const
return player->HasAura(value1, SpellEffectIndex(value2));
case CONDITION_ITEM:
return player->HasItemCount(value1, value2);
+ case CONDITION_NOITEM:
+ return player->!HasItemCount(value1, 1);
case CONDITION_ITEM_EQUIPPED:
return player->HasItemOrGemWithIdEquipped(value1,1);
case CONDITION_ZONEID:
@@ -7484,6 +7486,16 @@ bool PlayerCondition::IsValid(ConditionType condition, uint32 value1, uint32 val
}
break;
}
+ case CONDITION_NOITEM:
+ {
+ ItemPrototype const *proto = ObjectMgr::GetItemPrototype(value1);
+ if(!proto)
+ {
+ sLog.outErrorDb("Item condition requires to have non existing item (%u), skipped", value1);
+ return false;
+ }
+ break;
+ }
case CONDITION_ITEM_EQUIPPED:
{
ItemPrototype const *proto = ObjectMgr::GetItemPrototype(value1);
diff --git a/src/game/ObjectMgr.h b/src/game/ObjectMgr.h
index 4442f56..d0fb9c5 100644
--- a/src/game/ObjectMgr.h
+++ b/src/game/ObjectMgr.h
@@ -301,6 +301,7 @@ enum ConditionType
CONDITION_AURA = 1, // spell_id effindex
CONDITION_ITEM = 2, // item_id count
CONDITION_ITEM_EQUIPPED = 3, // item_id 0
+ CONDITION_NOITEM = 16, // item_id 0
CONDITION_ZONEID = 4, // zone_id 0
CONDITION_REPUTATION_RANK = 5, // faction_id min_rank
CONDITION_TEAM = 6, // player_team 0, (469 - Alliance 67 - Horde)
@@ -315,7 +316,7 @@ enum ConditionType
CONDITION_LEVEL = 15, // player_level 0, 1 or 2 (0: equal to, 1: equal or higher than, 2: equal or less than)
};

-#define MAX_CONDITION 16 // maximum value in ConditionType enum
+#define MAX_CONDITION 17 // maximum value in ConditionType enum

struct PlayerCondition
{

Необходимые условия для множества gossip' ов, которые требуют отсутствия итемов в инвентаре.

PSZ
12.03.2010, 08:49
Ээээ.... WTF?
Всего 2 вопроса:
1. При чем здесь "Penance - Interrupt"?
2. Зачем публиковать чужой, да еще и уже принятый патч? (http://ru-mangos.ru/showthread.php?t=71)