Fix OnSpellTile check (#3021)

This commit is contained in:
obligaron 2021-10-06 08:35:59 +02:00 committed by GitHub
commit 6b8b6ba77b
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 2 additions and 4 deletions

View file

@ -979,8 +979,6 @@ DWORD OnSpellTile(const TCmd *pCmd, Player &player)
return sizeof(message);
if (message.wParam2 > RSPLTYPE_INVALID)
return sizeof(message);
if (message.wParam3 > static_cast<int>(Direction::SouthEast))
return sizeof(message);
auto spell = static_cast<spell_id>(message.wParam1);
if (currlevel == 0 && !spelldata[spell].sTownSpell) {
@ -992,7 +990,7 @@ DWORD OnSpellTile(const TCmd *pCmd, Player &player)
player.destAction = ACTION_SPELL;
player.destParam1 = position.x;
player.destParam2 = position.y;
player.destParam3 = static_cast<Direction>(message.wParam3);
player.destParam4 = message.wParam3;
player._pSpell = spell;
player._pSplType = static_cast<spell_type>(message.wParam2);