aboutsummaryrefslogtreecommitdiff
path: root/Minecraft.World
diff options
context:
space:
mode:
authoriris <60985521+KaiAF@users.noreply.github.com>2026-03-15 18:13:03 -0500
committerGitHub <noreply@github.com>2026-03-15 18:13:03 -0500
commitb27cb536a5278313a892e6b3e8a7c86aa66c668e (patch)
tree62ac6bb1e6dc89082dc0177fe56a56a2295a142a /Minecraft.World
parent15ea3dc85c240fba0f651834be8222e1cf592beb (diff)
Fix game crashing when crafting fireworks (#1230) (#1240)
Diffstat (limited to 'Minecraft.World')
-rw-r--r--Minecraft.World/FireworksRecipe.cpp3
1 files changed, 3 insertions, 0 deletions
diff --git a/Minecraft.World/FireworksRecipe.cpp b/Minecraft.World/FireworksRecipe.cpp
index feb1cf57..c4a9ca80 100644
--- a/Minecraft.World/FireworksRecipe.cpp
+++ b/Minecraft.World/FireworksRecipe.cpp
@@ -37,6 +37,7 @@ void FireworksRecipe::ReleaseThreadStorage()
void FireworksRecipe::setResultItem(shared_ptr<ItemInstance> item)
{
ThreadStorage *tls = static_cast<ThreadStorage *>(TlsGetValue(tlsIdx));
+ if (tls == nullptr) tls = tlsDefault;
tls->resultItem = item;
}
@@ -269,6 +270,7 @@ bool FireworksRecipe::matches(shared_ptr<CraftingContainer> craftSlots, Level *l
shared_ptr<ItemInstance> FireworksRecipe::assemble(shared_ptr<CraftingContainer> craftSlots)
{
ThreadStorage *tls = static_cast<ThreadStorage *>(TlsGetValue(tlsIdx));
+ if (tls == nullptr) tls = tlsDefault;
return tls->resultItem->copy();
//return resultItem->copy();
}
@@ -281,6 +283,7 @@ int FireworksRecipe::size()
const ItemInstance *FireworksRecipe::getResultItem()
{
ThreadStorage *tls = static_cast<ThreadStorage *>(TlsGetValue(tlsIdx));
+ if (tls == nullptr) tls = tlsDefault;
return tls->resultItem.get();
//return resultItem.get();
}