Browse Source

fix resurrect (#2577)

pull/2587/head
qndel 5 years ago committed by GitHub
parent
commit
bb4d087d60
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 5
      Source/spells.cpp
  2. 2
      Source/spells.h

5
Source/spells.cpp

@ -249,14 +249,15 @@ void CastSpell(int id, int spl, int sx, int sy, int dx, int dy, int spllvl)
* @param pnum player index
* @param rid target player index
*/
void DoResurrect(int pnum, int rid)
void DoResurrect(int pnum, uint16_t rid)
{
if (pnum == MyPlayerId) {
NewCursor(CURSOR_HAND);
}
if (rid == -1)
if ((DWORD)pnum >= MAX_PLRS || rid >= MAX_PLRS) {
return;
}
auto &target = Players[rid];

2
Source/spells.h

@ -21,7 +21,7 @@ void UseMana(int id, spell_id sn);
SpellCheckResult CheckSpell(int id, spell_id sn, spell_type st, bool manaonly);
void EnsureValidReadiedSpell(PlayerStruct &player);
void CastSpell(int id, int spl, int sx, int sy, int dx, int dy, int spllvl);
void DoResurrect(int pnum, int rid);
void DoResurrect(int pnum, uint16_t rid);
void DoHealOther(int pnum, uint16_t rid);
int GetSpellBookLevel(spell_id s);
int GetSpellStaffLevel(spell_id s);

Loading…
Cancel
Save