feat(activity): GetActivityUser, the first player with activity data

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
Aaron Kimbrell
2026-11-27 19:09:53 -06:00
parent 7a6a1124f3
commit 22e115414f
2 changed files with 9 additions and 0 deletions

View File

@@ -275,6 +275,10 @@ float_t ActivityComponent::GetActivityValue(LWOOBJID playerID, uint32_t index) c
return value;
}
LWOOBJID ActivityComponent::GetActivityUser() const {
return m_ActivityPlayers.empty() ? LWOOBJID_EMPTY : m_ActivityPlayers.begin()->first;
}
void ActivityComponent::SetActivityValue(LWOOBJID playerID, uint32_t index, float_t value) {
auto& data = m_ActivityPlayers[playerID];
data[std::min(index, static_cast<uint32_t>(9))] = value;

View File

@@ -268,6 +268,11 @@ public:
*/
float_t GetActivityValue(LWOOBJID playerID, uint32_t index) const;
/**
* The activity's user (GetActivityUser): the first player with activity data, or LWOOBJID_EMPTY when none has any
*/
LWOOBJID GetActivityUser() const;
/**
* Removes activity score tracking for some entity
* @param playerID the entity to remove score for