Added nil check for attack wand.

This commit is contained in:
IQuant 2024-08-20 11:18:52 +03:00
parent 00be66f3e9
commit 14e8af3144

View file

@ -412,7 +412,9 @@ local function update()
if has_potion then
np.SetActiveHeldEntity(state.entity, state.potions[1], false, false)
else
np.SetActiveHeldEntity(state.entity, state.attack_wand, false, false)
if state.attack_wand ~= nil then
np.SetActiveHeldEntity(state.entity, state.attack_wand, false, false)
end
end
if has_potion and GameGetFrameNum() % 300 == 299 then
table.remove(state.potions, 1)