Browse Source

Change CastSpell to Player reference

pull/6846/head
obligaron 2 years ago committed by Gleb Mazovetskiy
parent
commit
f445bb4ef8
  1. 2
      Source/lua/modules/dev/towners.cpp
  2. 2
      Source/player.cpp
  3. 3
      Source/spells.cpp
  4. 2
      Source/spells.h

2
Source/lua/modules/dev/towners.cpp

@ -62,7 +62,7 @@ std::string DebugCmdVisitTowner(std::string_view name)
for (const Towner &towner : Towners) {
if (towner._ttype != it->second) continue;
CastSpell(
static_cast<int>(MyPlayerId),
*MyPlayer,
SpellID::Teleport,
myPlayer.position.tile,
towner.position,

2
Source/player.cpp

@ -1044,7 +1044,7 @@ bool DoSpell(Player &player)
{
if (player.AnimInfo.currentFrame == player._pSFNum) {
CastSpell(
player.getId(),
player,
player.executedSpell.spellId,
player.position.tile,
player.position.temp,

3
Source/spells.cpp

@ -209,9 +209,8 @@ SpellCheckResult CheckSpell(const Player &player, SpellID sn, SpellType st, bool
return SpellCheckResult::Success;
}
void CastSpell(int id, SpellID spl, WorldTilePosition src, WorldTilePosition dst, int spllvl)
void CastSpell(Player &player, SpellID spl, WorldTilePosition src, WorldTilePosition dst, int spllvl)
{
Player &player = Players[id];
Direction dir = player._pdir;
if (IsWallSpell(spl)) {
dir = player.tempDirection;

2
Source/spells.h

@ -35,7 +35,7 @@ SpellCheckResult CheckSpell(const Player &player, SpellID sn, SpellType st, bool
* @param player The player whose readied spell is to be checked.
*/
void EnsureValidReadiedSpell(Player &player);
void CastSpell(int id, SpellID spl, WorldTilePosition src, WorldTilePosition dst, int spllvl);
void CastSpell(Player &player, SpellID spl, WorldTilePosition src, WorldTilePosition dst, int spllvl);
/**
* @param pnum player index

Loading…
Cancel
Save