Skip to content

Commit

Permalink
Fix crash when adding items
Browse files Browse the repository at this point in the history
  • Loading branch information
maximegmd committed Nov 21, 2024
1 parent 9704338 commit 4ad1dc4
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions code/client/App/World/AppearanceSystem.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -77,9 +77,20 @@ void AddItems(Red::Handle<Red::game::Object> & object, Red::DynArray<Red::TweakD

auto item_record = Red::Handle<Red::game::data::Item_Record>();
GetItemRecord(&item_record, item);
if (!item_record)
{
spdlog::warn("Item record not found");
continue;
}

auto placementSlotHandle = Red::Handle<Red::game::data::AttachmentSlot_Record>();
GetPlacementSlot(item_record.instance, &placementSlotHandle, 0);
if (!placementSlotHandle)
{
spdlog::warn("Placement slot not found... kinda weird");
continue;
}

auto placementSlot = placementSlotHandle.instance->recordID;

Red::CString str;
Expand Down

0 comments on commit 4ad1dc4

Please sign in to comment.