Skip to content

Commit

Permalink
Core/Gameobjects: Fixed GO_DYNFLAG_LO_HIGHLIGHT application (TrinityC…
Browse files Browse the repository at this point in the history
  • Loading branch information
meji46 authored Sep 16, 2024
1 parent 76b9d85 commit 6bcef33
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 8 deletions.
20 changes: 13 additions & 7 deletions src/server/game/Entities/Object/Updates/ViewerDependentValues.h
Original file line number Diff line number Diff line change
Expand Up @@ -93,11 +93,8 @@ class ViewerDependentValue<UF::ObjectData::DynamicFlagsTag>
case GAMEOBJECT_TYPE_BUTTON:
case GAMEOBJECT_TYPE_GOOBER:
if (gameObject->HasConditionalInteraction() && gameObject->CanActivateForPlayer(receiver))
{
dynFlags |= GO_DYNFLAG_LO_HIGHLIGHT;
if (gameObject->GetGoStateFor(receiver->GetGUID()) != GO_STATE_ACTIVE)
dynFlags |= GO_DYNFLAG_LO_ACTIVATE;
}
dynFlags |= GO_DYNFLAG_LO_ACTIVATE | GO_DYNFLAG_LO_HIGHLIGHT;
break;
case GAMEOBJECT_TYPE_QUESTGIVER:
if (gameObject->CanActivateForPlayer(receiver))
Expand All @@ -112,7 +109,7 @@ class ViewerDependentValue<UF::ObjectData::DynamicFlagsTag>
case GAMEOBJECT_TYPE_GENERIC:
case GAMEOBJECT_TYPE_SPELL_FOCUS:
if (gameObject->HasConditionalInteraction() && gameObject->CanActivateForPlayer(receiver))
dynFlags |= GO_DYNFLAG_LO_SPARKLE | GO_DYNFLAG_LO_HIGHLIGHT;
dynFlags |= GO_DYNFLAG_LO_SPARKLE;
break;
case GAMEOBJECT_TYPE_TRANSPORT:
case GAMEOBJECT_TYPE_MAP_OBJ_TRANSPORT:
Expand All @@ -137,8 +134,17 @@ class ViewerDependentValue<UF::ObjectData::DynamicFlagsTag>
break;
}

if (!receiver->IsGameMaster() && !gameObject->MeetsInteractCondition(receiver))
dynFlags |= GO_DYNFLAG_LO_NO_INTERACT;
if (!receiver->IsGameMaster())
{
// GO_DYNFLAG_LO_INTERACT_COND should be applied to GOs with conditional interaction (without GO_FLAG_INTERACT_COND) to disable interaction
// (Ignore GAMEOBJECT_TYPE_GATHERING_NODE as some profession-related GOs may include quest loot and can always be interacted with)
if (gameObject->GetGoType() != GAMEOBJECT_TYPE_GATHERING_NODE)
if (gameObject->HasConditionalInteraction() && !gameObject->HasFlag(GO_FLAG_INTERACT_COND))
dynFlags |= GO_DYNFLAG_LO_INTERACT_COND;

if (!gameObject->MeetsInteractCondition(receiver))
dynFlags |= GO_DYNFLAG_LO_NO_INTERACT;
}

dynamicFlags = (uint32(pathProgress) << 16) | uint32(dynFlags);
}
Expand Down
3 changes: 2 additions & 1 deletion src/server/game/Miscellaneous/SharedDefines.h
Original file line number Diff line number Diff line change
Expand Up @@ -3032,7 +3032,8 @@ enum GameObjectDynamicLowFlags : uint16
GO_DYNFLAG_LO_STOPPED = 0x0040, // Transport is stopped
GO_DYNFLAG_LO_NO_INTERACT = 0x0080,
GO_DYNFLAG_LO_INVERTED_MOVEMENT = 0x0100, // GAMEOBJECT_TYPE_TRANSPORT only
GO_DYNFLAG_LO_HIGHLIGHT = 0x0200, // Allows object highlight when GO_DYNFLAG_LO_ACTIVATE or GO_DYNFLAG_LO_SPARKLE are set, not only when player is on quest determined by Data fields
GO_DYNFLAG_LO_INTERACT_COND = 0x0200, // Cannot interact (requires GO_DYNFLAG_LO_ACTIVATE to enable interaction clientside)
GO_DYNFLAG_LO_HIGHLIGHT = 0x4000, // Allows object highlight when GO_DYNFLAG_LO_ACTIVATE are set, not only when player is on quest determined by Data fields
};

// client side GO show states
Expand Down

0 comments on commit 6bcef33

Please sign in to comment.