Skip to content

Commit

Permalink
[10406] Fixed work .learn and other spell commands with unlearned tal…
Browse files Browse the repository at this point in the history
…ent shift-link.

Unlearned talent have -1 as rank in shift-link, return instead first rank.
  • Loading branch information
VladimirMangos committed Aug 24, 2010
1 parent f10d43f commit 1672bf5
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
7 changes: 5 additions & 2 deletions src/game/Chat.cpp
Expand Up @@ -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:
Expand Down
2 changes: 1 addition & 1 deletion src/shared/revision_nr.h
@@ -1,4 +1,4 @@
#ifndef __REVISION_NR_H__
#define __REVISION_NR_H__
#define REVISION_NR "10405"
#define REVISION_NR "10406"
#endif // __REVISION_NR_H__

0 comments on commit 1672bf5

Please sign in to comment.