Skip to content

Commit 3fcf610

Browse files
committed
Add CMaNGOS Cata exceptions for item methods
1 parent 957a3b8 commit 3fcf610

File tree

1 file changed

+12
-2
lines changed

1 file changed

+12
-2
lines changed

methods/CMangos/ItemMethods.h

+12-2
Original file line numberDiff line numberDiff line change
@@ -639,14 +639,15 @@ namespace LuaItem
639639
/**
640640
* Returns the damage info of the specified damage slot of this [Item]
641641
*
642-
* @param uint8 damageSlot : the damage slot specified (1 or 2)
642+
* @param uint8 damageSlot : the damage slot specified (1 or 2), slot does not apply to Cata
643643
* @return uint32 damageType
644644
* @return float minDamage
645645
* @return float maxDamage
646646
*/
647647
int GetDamageInfo(Eluna* E, Item* item)
648648
{
649-
uint8 damageSlot = E->CHECKVAL<uint8>(2);
649+
uint8 damageSlot = E->CHECKVAL<uint8>(2); // Not used in Cata but reading for compatibility
650+
#if ELUNA_EXPANSION < CATA
650651
uint32 damageType = 0;
651652
float damageMin = 0;
652653
float damageMax = 0;
@@ -662,6 +663,11 @@ namespace LuaItem
662663
E->Push(damageType);
663664
E->Push(damageMin);
664665
E->Push(damageMax);
666+
#else
667+
E->Push(item->GetTemplate()->DamageType);
668+
E->Push(item->GetTemplate()->GetMinDamage());
669+
E->Push(item->GetTemplate()->GetMaxDamage());
670+
#endif
665671
return 3;
666672
}
667673

@@ -683,7 +689,11 @@ namespace LuaItem
683689
*/
684690
int GetArmor(Eluna* E, Item* item)
685691
{
692+
#if ELUNA_EXPANSION < EXP_CATA
686693
E->Push(item->GetTemplate()->Armor);
694+
#else
695+
E->Push(item->GetTemplate()->GetArmor());
696+
#endif
687697
return 1;
688698
}
689699

0 commit comments

Comments
 (0)