@@ -1069,6 +1069,12 @@ local function teleport_outside_cursed()
1069
1069
end
1070
1070
1071
1071
local function hold_something ()
1072
+ if state .init_timer == 10 then
1073
+ state .attack_wand = wandfinder .find_attack_wand ({state .attack_wand })
1074
+ end
1075
+ if state .init_timer == 40 then
1076
+ state .attack_wand = wandfinder .find_attack_wand ({})
1077
+ end
1072
1078
if GameGetFrameNum () % 20 == 5 then
1073
1079
find_new_wand ()
1074
1080
end
@@ -1175,7 +1181,7 @@ local function hold_something()
1175
1181
spectate .disable_throwing (true , ctx .my_player .entity )
1176
1182
end
1177
1183
1178
- if has_water_potion or state .water_potion ~= nil then
1184
+ if ( has_water_potion or state .water_potion ~= nil ) and state . water_potions [ 1 ] ~= nil then
1179
1185
state .expected_held = state .water_potions [1 ]
1180
1186
np .SetActiveHeldEntity (state .entity , state .water_potions [1 ], false , false )
1181
1187
if state .water_potion == nil then
@@ -1187,7 +1193,7 @@ local function hold_something()
1187
1193
state .had_potion = true
1188
1194
end
1189
1195
state .bathe = not target_is_ambrosia
1190
- elseif (has_bad_potion or state .bad_potion ~= nil ) and tablet then
1196
+ elseif (has_bad_potion or state .bad_potion ~= nil ) and tablet and state . bad_potions [ i ] ~= nil then
1191
1197
state .expected_held = state .bad_potions [i ]
1192
1198
if EntityHasTag (state .bad_potions [i ], " potion" ) then
1193
1199
state .had_potion = true
@@ -1197,7 +1203,7 @@ local function hold_something()
1197
1203
state .bad_potion = state .bad_potions [i ]
1198
1204
changed_held = true
1199
1205
end
1200
- elseif has_good_potion or state .good_potion ~= nil then
1206
+ elseif ( has_good_potion or state .good_potion ~= nil ) and state . good_potion [ 1 ] ~= nil then
1201
1207
if EntityHasTag (state .good_potions [1 ], " potion" ) then
1202
1208
state .had_potion = true
1203
1209
end
@@ -1207,11 +1213,9 @@ local function hold_something()
1207
1213
state .good_potion = state .good_potions [1 ]
1208
1214
changed_held = true
1209
1215
end
1210
- else
1211
- if state .attack_wand ~= nil then
1212
- state .expected_held = state .attack_wand
1213
- np .SetActiveHeldEntity (state .entity , state .attack_wand , false , false )
1214
- end
1216
+ elseif state .attack_wand ~= nil then
1217
+ state .expected_held = state .attack_wand
1218
+ np .SetActiveHeldEntity (state .entity , state .attack_wand , false , false )
1215
1219
end
1216
1220
local holding2 = ComponentGetValue2 (inventory , " mActualActiveItem" )
1217
1221
if holding ~= holding2 then
0 commit comments