Fix Health access attempts outside hooks

(large monster updated in previous commit)
This commit is contained in:
GreenComfyTea
2023-08-06 14:26:59 +03:00
parent e389f6cf53
commit c4b7f6d195
3 changed files with 4 additions and 4 deletions

View File

@@ -154,7 +154,8 @@ function this.update_large_monster(enemy)
large_monster.update_stamina_timer(enemy, monster, nil);
large_monster.update_rage_timer(enemy, monster, nil);
if quest_status.is_online and players.myself.id ~= 0 then
if (quest_status.is_online and players.myself.id ~= 0)
or not monster.is_health_initialized then
local physical_param = large_monster.update_health(enemy, monster);
pcall(large_monster.update_parts, enemy, monster, physical_param);
pcall(large_monster.update_anomaly_parts, enemy, monster, nil);
@@ -195,7 +196,8 @@ function this.update_small_monster(enemy)
small_monster.update(enemy, monster);
if quest_status.is_online and players.myself.id ~= 0 then
if (quest_status.is_online and players.myself.id ~= 0)
or not monster.is_health_initialized then
small_monster.update_health(enemy, monster);
end
end

View File

@@ -71,7 +71,6 @@ function this.new(enemy)
this.init_UI(monster);
this.update_position(enemy, monster);
this.update_health(enemy, monster);
this.update(enemy, monster);
if this.list[enemy] == nil then