TeamREPENTOGON / TeamREPENTOGON/REPENTOGON
SetCustomShader causing errors when reloading mods
Nobody has claimed this yet.
- Dominant language
- C++
- Stars
- 345
- Forks
- 51
- Avg merge
- 11h 2m
- Merged PRs (30d)
- 4
Description
I've found this issue happening with 2 mods so far. If an affected mod is enabled and I update the mod list in-game (even double-tapping tab works), the game will crash instead of restarting. Not sure how much damage it actually causes, as I don't recall running into any save data issues and such, but it's likely worth reporting either way.
First crashing mod is The Eighteenth Isaac Character. The crash appears to be related to the mod's usage of SetCustomShader on line 554 of its main.lua file, as removing that line fixed the issue.
for _, v in ipairs({MOD.PLAYER_18, MOD.PLAYER_18_B}) do
local sprite = EntityConfig.GetPlayer(v):GetModdedCoopMenuSprite()
local hair = sprite:GetLayer(1)
hair:SetVisible(false)
local head = sprite:GetLayer(0)
head:SetCustomShader("shaders_18/icon") -- <= The Scoundrel.
local color = v == MOD.PLAYER_18_B and MOD.COLOR_HAIR_B or MOD.COLOR_HAIR
head:SetColor(Color(
1, 1, 1,
1,
0, 0, 0,
color.R, color.G, color.B
))
end
The second mod isn't public yet, so I cannot link it, but in its case the issue was also fixed by removing a SetCustomShader call. Worth noting that this mod used SetCustomShader on multiple occasions, but only that one instance was causing crashes during testing. Main difference I've noticed was that those other uses of SetCustomShader were done on Sprites of in-game entities, while the crash-causing line was on a standalone Sprite object instantiated and loaded in Lua at the top of a specific file.
For the record, I never entered an actual run during tests. Just went straight to the mod list, double-tapped tab, then exited to trigger the reload. Crashes were still getting reproduced either way, but it would explain why those other uses of SetCustomShader weren't causing it.
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Reproduce the crash by enabling The Eighteenth Isaac Character, updating the in-game mod list, and reloading or exiting; the reported call is SetCustomShader on line 554 of the mod's main.lua. Compare that standalone Sprite use with the other SetCustomShader calls on entity Sprites, then verify that the mod-list reload completes without crashing.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- cpp, lua
- Domain
- computer-graphics, game-dev
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Active
- Clarity
- Mostly clear
- Newbie friendliness
- 48/100