Skip to content

Commit

Permalink
Load objcurs when creating starting items
Browse files Browse the repository at this point in the history
  • Loading branch information
StephenCWills authored and AJenbo committed Feb 23, 2024
1 parent b433b7e commit bc4f434
Show file tree
Hide file tree
Showing 3 changed files with 2 additions and 3 deletions.
2 changes: 2 additions & 0 deletions Source/items.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3023,11 +3023,13 @@ void CreatePlrItems(Player &player)
}
}

InitCursor();
for (auto &itemChoice : loadout.items) {
_item_indexes itemData = gbIsHellfire && itemChoice.hellfire != _item_indexes::IDI_NONE ? itemChoice.hellfire : itemChoice.diablo;
if (itemData != _item_indexes::IDI_NONE)
CreateStartingItem(player, itemData);
}
FreeCursor();

if (loadout.gold > 0) {
Item &goldItem = player.InvList[player._pNumInv];
Expand Down
2 changes: 0 additions & 2 deletions test/player_test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -188,8 +188,6 @@ TEST(Player, CreatePlayer)
// Please provide them so that the tests can run successfully
ASSERT_TRUE(HaveSpawn() || HaveDiabdat());

InitCursor();

LoadPlayerDataFiles();
LoadItemData();
Players.resize(1);
Expand Down
1 change: 0 additions & 1 deletion test/writehero_test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -384,7 +384,6 @@ TEST(Writehero, pfile_write_hero)
MyPlayerId = 0;
MyPlayer = &Players[MyPlayerId];

InitCursor();
LoadSpellData();
LoadPlayerDataFiles();
LoadItemData();
Expand Down

0 comments on commit bc4f434

Please sign in to comment.