Skip to content

Commit

Permalink
Vehicle: Remove unconfirmed faulty implementation of VEHICLE_FLAG_PAS…
Browse files Browse the repository at this point in the history
…SIVE
  • Loading branch information
killerwife committed Jan 26, 2024
1 parent 92612ed commit 2b71c05
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 12 deletions.
12 changes: 1 addition & 11 deletions src/game/Entities/Vehicle.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -241,14 +241,6 @@ void VehicleInfo::Initialize()
if (vehicleFlags & VEHICLE_FLAG_FIXED_POSITION)
pVehicle->SetImmobilizedState(true);

// TODO: Guesswork, but it looks correct
if (vehicleFlags & VEHICLE_FLAG_PASSIVE)
{
if (pVehicle->AI())
pVehicle->AI()->SetReactState(REACT_PASSIVE);
pVehicle->SetCanEnterCombat(false);

This comment has been minimized.

Copy link
@insunaa

insunaa Jan 26, 2024

Contributor

the flag may have been wrong, but many player-controlled vehicles should actually not be able to enter combat unless controlled by a player

This comment has been minimized.

Copy link
@killerwife

killerwife Jan 26, 2024

Author Contributor

Perfectly fine to do so in AI.

}

// Initialize power type based on DBC values (creatures only)
if (pVehicle->GetTypeId() == TYPEID_UNIT)
{
Expand Down Expand Up @@ -881,9 +873,7 @@ void VehicleInfo::RemoveSeatMods(Unit* passenger, uint32 seatFlags)
// reset vehicle faction
((Creature*)pVehicle)->SetFactionTemporary(m_originalFaction, TEMPFACTION_NONE);

// Reset react state
if (!(GetVehicleEntry()->m_flags & VEHICLE_FLAG_PASSIVE))
pVehicle->AI()->SetReactState(REACT_AGGRESSIVE);
pVehicle->AI()->SetReactState(REACT_AGGRESSIVE);
}
}

Expand Down
2 changes: 1 addition & 1 deletion src/game/Server/DBCEnums.h
Original file line number Diff line number Diff line change
Expand Up @@ -538,7 +538,7 @@ enum VehicleFlags
VEHICLE_FLAG_UNK5 = 0x00001000,
VEHICLE_FLAG_UNK6 = 0x00002000,
VEHICLE_FLAG_UNK7 = 0x00004000,
VEHICLE_FLAG_PASSIVE = 0x00008000, // Vehicle has a passive reaction to hostiles?
VEHICLE_FLAG_UNK8 = 0x00008000,
VEHICLE_FLAG_UNK9 = 0x00010000,
VEHICLE_FLAG_UNK10 = 0x00020000,
VEHICLE_FLAG_UNK11 = 0x00040000,
Expand Down

0 comments on commit 2b71c05

Please sign in to comment.