Browse Source

Merge f0e6fbf487 into 5a08031caf

pull/8333/merge
Eric Robinson 4 days ago committed by GitHub
parent
commit
2ede2a97f9
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
  1. 8
      Source/controls/plrctrls.cpp
  2. 6
      Source/player.cpp
  3. 4
      docs/CHANGELOG.md

8
Source/controls/plrctrls.cpp

@ -385,7 +385,7 @@ void CheckPlayerNearby()
const Player &myPlayer = *MyPlayer;
const SpellID spl = myPlayer._pRSpell;
if (myPlayer.friendlyMode && spl != SpellID::Resurrect && spl != SpellID::HealOther)
if (myPlayer.friendlyMode && IsNoneOf(spl, SpellID::Resurrect, SpellID::HealOther))
return;
for (const Player &player : Players) {
@ -393,12 +393,12 @@ void CheckPlayerNearby()
continue;
const int mx = player.position.future.x;
const int my = player.position.future.y;
if (dPlayer[mx][my] == 0
if ((dPlayer[mx][my] == 0 && spl != SpellID::Resurrect)
|| !IsTileLit(player.position.future)
|| (player.hasNoLife() && spl != SpellID::Resurrect))
continue;
if (myPlayer.UsesRangedWeapon() || HasRangedSpell() || spl == SpellID::HealOther) {
if (myPlayer.UsesRangedWeapon() || HasRangedSpell() || IsAnyOf(spl, SpellID::Resurrect, SpellID::HealOther)) {
newDdistance = GetDistanceRanged(player.position.future);
} else {
newDdistance = GetDistance(player.position.future, distance);
@ -2133,7 +2133,7 @@ void PerformSpellAction()
const Player &myPlayer = *MyPlayer;
const SpellID spl = myPlayer._pRSpell;
if ((PlayerUnderCursor == nullptr && (spl == SpellID::Resurrect || spl == SpellID::HealOther))
if ((PlayerUnderCursor == nullptr && IsAnyOf(spl, SpellID::Resurrect, SpellID::HealOther))
|| (ObjectUnderCursor == nullptr && spl == SpellID::TrapDisarm)) {
myPlayer.Say(HeroSpeech::ICantCastThatHere);
return;

6
Source/player.cpp

@ -1117,7 +1117,7 @@ void CheckNewPath(Player &player, bool pmWillBeCalled)
case ACTION_RATTACKPLR:
case ACTION_SPELLPLR:
target = &Players[targetId];
if (target->hasNoLife()) {
if (target->hasNoLife() && player.queuedSpell.spellId != SpellID::Resurrect) {
player.Stop();
return;
}
@ -3208,7 +3208,9 @@ void CheckPlrSpell(bool isShiftHeld, SpellID spellID, SpellType spellType)
} else if (pcursmonst != -1 && !isShiftHeld) {
LastPlayerAction = PlayerActionType::SpellMonsterTarget;
NetSendCmdParam4(true, CMD_SPELLID, pcursmonst, static_cast<int8_t>(spellID), static_cast<uint8_t>(spellType), spellFrom);
} else if (PlayerUnderCursor != nullptr && !PlayerUnderCursor->hasNoLife() && !isShiftHeld && !myPlayer.friendlyMode) {
} else if (PlayerUnderCursor != nullptr && !isShiftHeld
&& (!myPlayer.friendlyMode || IsAnyOf(spellID, SpellID::HealOther, SpellID::Resurrect))
&& (!PlayerUnderCursor->hasNoLife() || spellID == SpellID::Resurrect)) {
LastPlayerAction = PlayerActionType::SpellPlayerTarget;
NetSendCmdParam4(true, CMD_SPELLPID, PlayerUnderCursor->getId(), static_cast<int8_t>(spellID), static_cast<uint8_t>(spellType), spellFrom);
} else {

4
docs/CHANGELOG.md

@ -14,6 +14,10 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
### Bug Fixes
#### Controls
- Gamepad: Unable to cast Resurrect on players
#### Graphics / Audio
- Music doesn't unmute when focus is lost on level transition with Auto Pause On Focus Lost disabled

Loading…
Cancel
Save