Skip to content

Commit

Permalink
Vehicles: Allow switching between vehicles from within vehicles
Browse files Browse the repository at this point in the history
  • Loading branch information
insunaa committed Aug 4, 2023
1 parent 3e78b4f commit 77dc3cd
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
2 changes: 2 additions & 0 deletions src/game/Entities/Vehicle.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -872,6 +872,8 @@ void VehicleInfo::RemoveSeatMods(Unit* passenger, uint32 seatFlags)
if (!(GetVehicleEntry()->m_flags & VEHICLE_FLAG_PASSIVE))
pVehicle->AI()->SetReactState(REACT_AGGRESSIVE);
}

pVehicle->SetTarget(nullptr);
}

// must be called after movement control unapplying
Expand Down
4 changes: 2 additions & 2 deletions src/game/Spells/Spell.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -6986,7 +6986,7 @@ SpellCastResult Spell::CheckCast(bool strict)
return SPELL_FAILED_BAD_TARGETS;

// It is possible to change between vehicles that are boarded on each other
if (m_caster->IsBoarded() && m_caster->GetTransportInfo()->IsOnVehicle())
/*if (m_caster->IsBoarded() && m_caster->GetTransportInfo()->IsOnVehicle())
{
// Check if trying to board a vehicle that is boarded on current transport
bool boardedOnEachOther = m_caster->GetTransportInfo()->HasOnBoard(expectedTarget);
Expand All @@ -6996,7 +6996,7 @@ SpellCastResult Spell::CheckCast(bool strict)

if (!boardedOnEachOther)
return SPELL_FAILED_NOT_ON_TRANSPORT;
}
}*/

if (!expectedTarget->GetVehicleInfo()->CanBoard(m_caster))
return SPELL_FAILED_BAD_TARGETS;
Expand Down

0 comments on commit 77dc3cd

Please sign in to comment.