Potential fix to damage meter showing incorrect players sometimes

This commit is contained in:
GreenComfyTea
2023-02-06 15:26:03 +02:00
parent b1d84ab739
commit fcf35d817f
4 changed files with 31 additions and 33 deletions

View File

@@ -291,8 +291,8 @@ if debug.enabled then
end end
if xy ~= "" then if xy ~= "" then
d2d.text(drawing.font, "xy:\n" .. tostring(xy), 551, 11, 0xFF000000); d2d.text(drawing.font, "xy:\n" .. tostring(xy), 6, 11, 0xFF000000);
d2d.text(drawing.font, "xy:\n" .. tostring(xy), 550, 10, 0xFFFFFFFF); d2d.text(drawing.font, "xy:\n" .. tostring(xy), 5, 10, 0xFFFFFFFF);
end end
end); end);
end end
@@ -303,8 +303,8 @@ if debug.enabled then
end end
if xy ~= "" then if xy ~= "" then
draw.text("xy:\n" .. tostring(xy), 551, 11, 0xFF000000); draw.text("xy:\n" .. tostring(xy), 6, 11, 0xFF000000);
draw.text("xy:\n" .. tostring(xy), 550, 10, 0xFFFFFFFF); draw.text("xy:\n" .. tostring(xy), 5, 10, 0xFFFFFFFF);
end end
end); end);
end end

View File

@@ -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(players.total, damage_source_type, is_large_monster, damage_object);
players.update_damage(player, 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) .. --if is_otomo_attack then
--" " .. tostring(attacking_player.name) .. --xy = xy .. "\nOtomo: " .. tostring(otomo.id) ..
--" Damage: " .. tostring(damage_object.total_damage) .. -- " " .. tostring(otomo.name) ..
--" Type: (" .. tostring(attacker_type); -- " Damage: " .. tostring(damage_object.total_damage);
--") " .. --end
--" Condition Damage: " .. tostring(condition_damage) ..
--" Condition Type: (" .. tostring(attacker_type) ..
--") " .. tostring(condition_type);
--[[if is_otomo_attack then --if string.len(xy) > 2000 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
-- xy = ""; -- xy = "";
--end --end
end end

View File

@@ -494,7 +494,7 @@ function players.init()
players.list = {}; players.list = {};
players.display_list = {}; players.display_list = {};
players.total = players.new(0, "Total", 0, 0, players.types.total); 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 end
local lobby_manager_type_def = sdk.find_type_definition("snow.LobbyManager"); 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]; 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 ~= nil then
if player.name == players.myself.name then if name == players.myself.name then
player = players.new(id, name, master_rank, hunter_rank, players.types.myself); player = players.new(id, name, master_rank, hunter_rank, players.types.myself);
players.myself = player; players.myself = player;
players.list[id] = player; players.list[id] = player;
end 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 else
player = players.new(id, name, master_rank, hunter_rank, players.types.other_player); player = players.new(id, name, master_rank, hunter_rank, players.types.other_player);
players.list[id] = player; players.list[id] = player;

View File

@@ -36,8 +36,6 @@ function time.tick()
time.elapsed_minutes = quest_time_elapsed_minutes; time.elapsed_minutes = quest_time_elapsed_minutes;
end end
local quest_time_total_elapsed_seconds = get_quest_elapsed_time_sec_method:call(singletons.quest_manager); local quest_time_total_elapsed_seconds = get_quest_elapsed_time_sec_method:call(singletons.quest_manager);
if quest_time_total_elapsed_seconds == nil then if quest_time_total_elapsed_seconds == nil then
customization_menu.status = "No quest time total elapsed seconds"; customization_menu.status = "No quest time total elapsed seconds";