If you freeslot a sprite inside of a function, like this:
you get an error (in addition to the sprite not being displayed):
But if you freeslot the sprite outside of the function, like this:
everything is fine, the sprite displays, and no errors occur.
Code:
addHook("ThinkFrame", do
if not _G["SPR_ABC1"]
freeslot("SPR_ABC1")
end
for p in players.iterate
if _G["SPR_ABC1"]
p.mo.sprite = SPR_ABC1
end
end
end)
Code:
ERROR: R_ProjectSprite: invalid sprite frame 0/0 for ABC1
Code:
freeslot("SPR_ABC1")
addHook("ThinkFrame", do
for p in players.iterate
p.mo.sprite = SPR_ABC1
end
end)
Last edited by a moderator: