Core/Vehicles: Prevent infinite loop in VehicleJoinEvent:Abort
This commit is contained in:
1 parent
9004d39c09
commit
cc8d5a3aca
2 files changed
+9
-1
No files matched your search
@@ -811,6 +811,11 @@ bool VehicleJoinEvent::Execute(uint64, uint32)
|
||||
|
||||
void VehicleJoinEvent::Abort(uint64)
|
||||
{
|
||||
// Prevent recursion
|
||||
if (_executedAbort)
|
||||
return;
|
||||
|
||||
_executedAbort = true;
|
||||
sLog->outDebug(LOG_FILTER_VEHICLES, "Passenger GuidLow: %u, Entry: %u, board on vehicle GuidLow: %u, Entry: %u SeatId: %i cancelled",
|
||||
Passenger->GetGUIDLow(), Passenger->GetEntry(), Target->GetBase()->GetGUIDLow(), Target->GetBase()->GetEntry(), (int32)Seat->first);
|
||||
|
||||
|
||||
@@ -107,12 +107,15 @@ class VehicleJoinEvent : public BasicEvent
|
||||
{
|
||||
friend class Vehicle;
|
||||
protected:
|
||||
VehicleJoinEvent(Vehicle* v, Unit* u) : Target(v), Passenger(u), Seat(Target->Seats.end()) {}
|
||||
VehicleJoinEvent(Vehicle* v, Unit* u) : Target(v), Passenger(u), Seat(Target->Seats.end()), _executedAbort(false) {}
|
||||
bool Execute(uint64, uint32);
|
||||
void Abort(uint64);
|
||||
|
||||
Vehicle* Target;
|
||||
Unit* Passenger;
|
||||
SeatMap::iterator Seat;
|
||||
|
||||
private:
|
||||
bool _executedAbort;
|
||||
};
|
||||
#endif
|
||||
Reference in new issue
Block a user