Skip to content

Commit

Permalink
Prevent teleporting onto players at new location
Browse files Browse the repository at this point in the history
  • Loading branch information
kphoenix137 committed Feb 26, 2024
1 parent 50ea3bf commit 040d630
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 6 deletions.
2 changes: 1 addition & 1 deletion Source/missiles.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -408,7 +408,7 @@ bool Plr2PlrMHit(const Player &player, Player &target, int mindam, int maxdam, i
dam *= 5;
break;
case MissileID::Lightning: // 100% (200% of default)
case MissileID::NovaBall: // 100% (200% of default)
case MissileID::NovaBall: // 100% (200% of default)
break;
}
} else {
Expand Down
7 changes: 3 additions & 4 deletions Source/player.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1120,10 +1120,9 @@ bool DoSpell(Player &player)
player.position.tile,
player.position.temp,
player.executedSpell.spellLevel,
player.hasMonsterTarget,
player.hasPlayerTarget,
player.targetId
);
player.hasMonsterTarget,
player.hasPlayerTarget,
player.targetId);

if (IsAnyOf(player.executedSpell.spellType, SpellType::Scroll, SpellType::Charges)) {
EnsureValidReadiedSpell(player);
Expand Down
2 changes: 1 addition & 1 deletion Source/spells.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -217,7 +217,7 @@ void CastSpell(Player &player, SpellID spl, WorldTilePosition src, WorldTilePosi
}

// PVP REBALANCE: Obtain target position upon spell effect, rather than when initiating the cast for accuracy in arenas.
if (player.isOnArenaLevel()) {
if (player.isOnArenaLevel() && spl != SpellID::Teleport) {
if (hasPlayerTarget) {
assert(targetId >= 0 && targetId < Players.size());
dst = Players[targetId].position.future;
Expand Down

0 comments on commit 040d630

Please sign in to comment.