MCPcopy Create free account
hub / github.com/diasurgical/devilution / GetSBookTrans

Function GetSBookTrans

Source/control.cpp:1718–1742  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1716}
1717
1718char GetSBookTrans(int ii, BOOL townok)
1719{
1720 char st;
1721
1722 st = RSPLTYPE_SPELL;
1723 if (plr[myplr]._pISpells & (__int64)1 << (ii - 1)) {
1724 st = RSPLTYPE_CHARGES;
1725 }
1726 if (plr[myplr]._pAblSpells & 1 << (ii - 1)) { /// BUGFIX: missing (__int64)
1727 st = RSPLTYPE_SKILL;
1728 }
1729 if (st == RSPLTYPE_SPELL) {
1730 if (!CheckSpell(myplr, ii, RSPLTYPE_SPELL, TRUE)) {
1731 st = RSPLTYPE_INVALID;
1732 }
1733 if ((char)(plr[myplr]._pSplLvl[ii] + plr[myplr]._pISplLvlAdd) <= 0) {
1734 st = RSPLTYPE_INVALID;
1735 }
1736 }
1737 if (townok && currlevel == 0 && st != RSPLTYPE_INVALID && !spelldata[ii].sTownSpell) {
1738 st = RSPLTYPE_INVALID;
1739 }
1740
1741 return st;
1742}
1743
1744void DrawSpellBook()
1745{

Callers 1

DrawSpellBookFunction · 0.85

Calls 1

CheckSpellFunction · 0.85

Tested by

no test coverage detected