Skip to content

Commit

Permalink
inject: fix item creation (LostArtefacts#1270)
Browse files Browse the repository at this point in the history
This uses the correct approach to create an item on the fly. The issue
itself was unreleased, and the change in c279b4e brought the bug to
light.

Resolves LostArtefacts#1266.
  • Loading branch information
lahm86 authored Apr 4, 2024
1 parent fe8bc32 commit ca04a5c
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/game/inject.c
Original file line number Diff line number Diff line change
Expand Up @@ -1277,7 +1277,9 @@ static void Inject_TriggeredItem(INJECTION *injection, LEVEL_INFO *level_info)
return;
}

ITEM_INFO *item = &g_Items[g_LevelItemCount];
int16_t item_number = Item_Create();
ITEM_INFO *item = &g_Items[item_number];

File_Read(&item->object_number, sizeof(int16_t), 1, fp);
File_Read(&item->room_number, sizeof(int16_t), 1, fp);
File_Read(&item->pos.x, sizeof(int32_t), 1, fp);
Expand Down

0 comments on commit ca04a5c

Please sign in to comment.