Core: VehicleJoinEvent crash fix

Port From (https://github.com/TrinityCore/TrinityCore/commit/fe0cff0caeda48cd49f5d3898607bdb34704b868)
This commit is contained in:
hondacrx
2021-11-29 17:28:45 -05:00
parent 356bbb8823
commit b44d086d37
+5
View File
@@ -574,6 +574,11 @@ namespace Game.Entities
return true;
}
//It's possible that multiple vehicle join
//events are executed in the same update
if (Passenger.GetVehicle() != null)
Passenger.ExitVehicle();
Passenger.SetVehicle(Target);
Seat.Value.Passenger.Guid = Passenger.GetGUID();
Seat.Value.Passenger.IsUnselectable = Passenger.HasUnitFlag(UnitFlags.NotSelectable);