fix a couple of errors, dont give polied players shields, dont let player arrows pop in and out of existance, fix poly players maybe not having movement after unpoly'ing

This commit is contained in:
bgkillas 2024-09-07 21:48:47 -04:00
parent c9bfc20f10
commit 204b282fdd
5 changed files with 29 additions and 8 deletions

View file

@ -305,6 +305,9 @@ local function on_world_post_update_inner()
GlobalsSetValue("ew_wand_fired", "0")
if times_wand_fired > 0 then
local inventory_component = EntityGetFirstComponentIncludingDisabled(ctx.my_player.entity, "Inventory2Component")
if inventory_component == nil then
return
end
local last_switch = ComponentGetValue2(inventory_component, "mLastItemSwitchFrame")
local switched_now = last_switch == GameGetFrameNum()