mirror of
https://github.com/TrinityCore/TrinityCore.git
synced 2026-01-21 01:37:37 +01:00
*More precise method for determining whether or not a seat is occupied (disregarding object size).
--HG-- branch : trunk
This commit is contained in:
@@ -1018,7 +1018,7 @@ void GameObject::Use(Unit* user)
|
||||
|
||||
if(itr->second)
|
||||
if(Player* ChairUser = objmgr.GetPlayer(itr->second))
|
||||
if(ChairUser->IsSitState() && ChairUser->getStandState() != UNIT_STAND_STATE_SIT && ChairUser->GetDistance2d(x_i, y_i) == 0)
|
||||
if(ChairUser->IsSitState() && ChairUser->getStandState() != UNIT_STAND_STATE_SIT && ChairUser->GetExactDist2d(x_i, y_i) < 0.1f)
|
||||
continue; // This seat is already occupied by ChairUser. NOTE: Not sure if the ChairUser->getStandState() != UNIT_STAND_STATE_SIT check is required.
|
||||
else
|
||||
itr->second = 0; // This seat is unoccupied.
|
||||
|
||||
Reference in New Issue
Block a user