[10406] Fixed work .learn and other spell commands with unlearned talent shift-link.

Unlearned talent have -1 as rank in shift-link, return instead first rank.
This commit is contained in:
VladimirMangos 2010-08-24 19:11:51 +04:00
parent 0ab4adf517
commit f3579fba64
2 changed files with 6 additions and 3 deletions

View file

@ -2750,10 +2750,13 @@ uint32 ChatHandler::ExtractSpellIdFromLink(char** text)
if(!talentEntry)
return 0;
uint32 rank;
if (!ExtractUInt32(&param1_str, rank))
int32 rank;
if (!ExtractInt32(&param1_str, rank))
return 0;
if (rank < 0) // unlearned talent have in shift-link field -1 as rank
rank = 0;
return rank < MAX_TALENT_RANK ? talentEntry->RankID[rank] : 0;
}
case SPELL_LINK_GLYPH:

View file

@ -1,4 +1,4 @@
#ifndef __REVISION_NR_H__
#define __REVISION_NR_H__
#define REVISION_NR "10405"
#define REVISION_NR "10406"
#endif // __REVISION_NR_H__