Skip to content

Commit

Permalink
Count warband rep (and allow auto-switch)
Browse files Browse the repository at this point in the history
  • Loading branch information
DJScias committed Sep 6, 2024
1 parent bfa27ae commit 12499c8
Showing 2 changed files with 13 additions and 0 deletions.
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -5,6 +5,11 @@ All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

## [6.1.8] - 2024-09-06

### Fixed
- Warband (Account-Wide) reputation gains were not properly counted and auto-switching did not work as a result (fully fixes [#10](https://github.com/DJScias/Experiencer2/issues/10)).

## [6.1.7] - 2024-09-05

### Fixed
8 changes: 8 additions & 0 deletions modules/reputation.lua
Original file line number Diff line number Diff line change
@@ -973,11 +973,19 @@ function module:UPDATE_FACTION()
end

local reputationPattern = FACTION_STANDING_INCREASED:gsub("%%s", "(.-)"):gsub("%%d", "(%%d*)%%");
local warbandReputationPattern = FACTION_STANDING_INCREASED_ACCOUNT_WIDE:gsub("%%s", "(.-)"):gsub("%%d", "(%%d*)%%");

function module:CHAT_MSG_COMBAT_FACTION_CHANGE(event, message, ...)
local reputation, amount = message:match(reputationPattern);
amount = tonumber(amount) or 0;

-- If no reputation is found, check for warband (account-wide).
if not reputation then
reputation, amount = message:match(warbandReputationPattern);
amount = tonumber(amount) or 0;
end

-- If not char-specific or warband reputation or keeping track of recent rep, end here.
if not reputation or not module.recentReputations then return end

local isGuild = false;

0 comments on commit 12499c8

Please sign in to comment.