Skip to content

Commit

Permalink
Fixed immersion option adding everybody in the arena on the player's …
Browse files Browse the repository at this point in the history
…group
  • Loading branch information
Tercioo committed May 4, 2023
1 parent 773ec43 commit 254f6bc
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 3 deletions.
9 changes: 9 additions & 0 deletions boot.lua
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,15 @@
Details222.GarbageCollector = {}
Details222.BreakdownWindow = {}

Details222.PlayerStats = {}

---add a statistic, log, or any other data to the player stat table
---@param statName string
---@param value number
function Details222.PlayerStats:AddStat(statName, value)
Details.player_stats[statName] = (Details.player_stats[statName] or 0) + value
end

-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
--initialization stuff
local _
Expand Down
8 changes: 5 additions & 3 deletions classes/container_actors.lua
Original file line number Diff line number Diff line change
Expand Up @@ -532,6 +532,8 @@ end
--read the actor flag
local readActorFlag = function(actorObject, ownerActorObject, actorSerial, actorFlags, actorName)
if (actorFlags) then
local _, zoneType = GetInstanceInfo()

--this is player actor
if (bitBand(actorFlags, OBJECT_TYPE_PLAYER) ~= 0) then
if (not Details.ignore_nicktag) then
Expand All @@ -549,7 +551,7 @@ end
end
end

if (Details.all_players_are_group or Details.immersion_enabled) then
if (zoneType ~= "arena" and (Details.all_players_are_group or Details.immersion_enabled)) then
actorObject.grupo = true
end

Expand Down Expand Up @@ -583,7 +585,7 @@ end
end
end

if (Details.is_in_arena) then
if (zoneType == "arena") then
--local my_team_color = GetBattlefieldArenaFaction and GetBattlefieldArenaFaction() or 0

--my team
Expand Down Expand Up @@ -958,7 +960,7 @@ end

if (novo_objeto.classe == "UNGROUPPLAYER") then --is a player
if (bitBand (actorFlags, REACTION_HOSTILE ) ~= 0) then --is hostile
novo_objeto.enemy = true --print(nome.." EH UM INIMIGO -> " .. engRace)
novo_objeto.enemy = true
end

--try to guess his class
Expand Down
2 changes: 2 additions & 0 deletions functions/profiles.lua
Original file line number Diff line number Diff line change
Expand Up @@ -1142,6 +1142,8 @@ local default_player_data = {
last_coach_name = false,
},

player_stats = {},

combat_log = {
inverse_deathlog_raid = false,
inverse_deathlog_mplus = false,
Expand Down

0 comments on commit 254f6bc

Please sign in to comment.