mirror of
https://github.com/GreenComfyTea/MHR-Overlay.git
synced 2026-01-24 12:28:03 -08:00
Potential fix to damage meter showing incorrect players sometimes
This commit is contained in:
@@ -291,8 +291,8 @@ if debug.enabled then
|
||||
end
|
||||
|
||||
if xy ~= "" then
|
||||
d2d.text(drawing.font, "xy:\n" .. tostring(xy), 551, 11, 0xFF000000);
|
||||
d2d.text(drawing.font, "xy:\n" .. tostring(xy), 550, 10, 0xFFFFFFFF);
|
||||
d2d.text(drawing.font, "xy:\n" .. tostring(xy), 6, 11, 0xFF000000);
|
||||
d2d.text(drawing.font, "xy:\n" .. tostring(xy), 5, 10, 0xFFFFFFFF);
|
||||
end
|
||||
end);
|
||||
end
|
||||
@@ -303,8 +303,8 @@ if debug.enabled then
|
||||
end
|
||||
|
||||
if xy ~= "" then
|
||||
draw.text("xy:\n" .. tostring(xy), 551, 11, 0xFF000000);
|
||||
draw.text("xy:\n" .. tostring(xy), 550, 10, 0xFFFFFFFF);
|
||||
draw.text("xy:\n" .. tostring(xy), 6, 11, 0xFF000000);
|
||||
draw.text("xy:\n" .. tostring(xy), 5, 10, 0xFFFFFFFF);
|
||||
end
|
||||
end);
|
||||
end
|
||||
|
||||
@@ -193,27 +193,17 @@ function damage_hook.update_damage(enemy, enemy_calc_damage_info)
|
||||
players.update_damage(players.total, damage_source_type, is_large_monster, damage_object);
|
||||
players.update_damage(player, damage_source_type, is_large_monster, damage_object);
|
||||
|
||||
--xy = xy .. "\nPlayer: " .. tostring(player.id) ..
|
||||
-- " " .. tostring(player.name) ..
|
||||
-- " Damage: " .. tostring(damage_object.total_damage);
|
||||
|
||||
--xy = xy .. "\nPlayer: " .. tostring(attacker_id) ..
|
||||
--" " .. tostring(attacking_player.name) ..
|
||||
--" Damage: " .. tostring(damage_object.total_damage) ..
|
||||
--" Type: (" .. tostring(attacker_type);
|
||||
--") " ..
|
||||
--" Condition Damage: " .. tostring(condition_damage) ..
|
||||
--" Condition Type: (" .. tostring(attacker_type) ..
|
||||
--") " .. tostring(condition_type);
|
||||
--if is_otomo_attack then
|
||||
--xy = xy .. "\nOtomo: " .. tostring(otomo.id) ..
|
||||
-- " " .. tostring(otomo.name) ..
|
||||
-- " Damage: " .. tostring(damage_object.total_damage);
|
||||
--end
|
||||
|
||||
--[[if is_otomo_attack then
|
||||
xy = xy .. "\nOtomo Master: " .. tostring(player.id) ..
|
||||
" " .. tostring(player.name) ..
|
||||
" Damage: " .. tostring(damage_object.total_damage);
|
||||
|
||||
xy = xy .. "\nOtomo: " .. tostring(otomo.id) ..
|
||||
" " .. tostring(otomo.name) ..
|
||||
" Damage: " .. tostring(damage_object.total_damage);
|
||||
end]]
|
||||
|
||||
--if string.len(xy) > 2700 then
|
||||
--if string.len(xy) > 2000 then
|
||||
-- xy = "";
|
||||
--end
|
||||
end
|
||||
|
||||
@@ -494,7 +494,7 @@ function players.init()
|
||||
players.list = {};
|
||||
players.display_list = {};
|
||||
players.total = players.new(0, "Total", 0, 0, players.types.total);
|
||||
players.myself = players.new(-1, "Dummy", -1, -1, players.types.myself);
|
||||
players.myself = players.new(-1, "DummyMHROverlay", -1, -1, players.types.myself);
|
||||
end
|
||||
|
||||
local lobby_manager_type_def = sdk.find_type_definition("snow.LobbyManager");
|
||||
@@ -607,13 +607,23 @@ function players.update_player_list_(hunter_info_field_)
|
||||
|
||||
local player = players.list[id];
|
||||
|
||||
if player == nil or (player.name ~= name and player.hunter_rank ~= hunter_rank and player.master_rank ~= master_rank) then
|
||||
if player ~= nil then
|
||||
if player.name == players.myself.name then
|
||||
player = players.new(id, name, master_rank, hunter_rank, players.types.myself);
|
||||
players.myself = player;
|
||||
players.list[id] = player;
|
||||
end
|
||||
if player == nil then
|
||||
|
||||
if name == players.myself.name then
|
||||
player = players.new(id, name, master_rank, hunter_rank, players.types.myself);
|
||||
players.myself = player;
|
||||
players.list[id] = player;
|
||||
else
|
||||
player = players.new(id, name, master_rank, hunter_rank, players.types.other_player);
|
||||
players.list[id] = player;
|
||||
end
|
||||
|
||||
elseif player.name ~= name or player.hunter_rank ~= hunter_rank or player.master_rank ~= master_rank then
|
||||
|
||||
if name == players.myself.name then
|
||||
player = players.new(id, name, master_rank, hunter_rank, players.types.myself);
|
||||
players.myself = player;
|
||||
players.list[id] = player;
|
||||
else
|
||||
player = players.new(id, name, master_rank, hunter_rank, players.types.other_player);
|
||||
players.list[id] = player;
|
||||
|
||||
@@ -36,8 +36,6 @@ function time.tick()
|
||||
time.elapsed_minutes = quest_time_elapsed_minutes;
|
||||
end
|
||||
|
||||
|
||||
|
||||
local quest_time_total_elapsed_seconds = get_quest_elapsed_time_sec_method:call(singletons.quest_manager);
|
||||
if quest_time_total_elapsed_seconds == nil then
|
||||
customization_menu.status = "No quest time total elapsed seconds";
|
||||
|
||||
Reference in New Issue
Block a user