Skip to content

Commit

Permalink
fix pistols at start of LEVEL10A
Browse files Browse the repository at this point in the history
  • Loading branch information
XProger committed Nov 20, 2018
1 parent 49abeea commit a9b73f0
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 11 deletions.
5 changes: 2 additions & 3 deletions src/lara.h
Original file line number Diff line number Diff line change
Expand Up @@ -524,9 +524,8 @@ struct Lara : Character {
if (level->version & TR::VER_TR1)
meshSwap(1, TR::MODEL_LARA_SPEC, JOINT_MASK_UPPER | JOINT_MASK_LOWER);
} else {
if (level->id == TR::LVL_TR2_HOUSE)
wpnSet(TR::Entity::SHOTGUN);
else
int *wpnAmmo = game->invCount(TR::Entity::PISTOLS);
if (wpnAmmo && *wpnAmmo > 0)
wpnSet(TR::Entity::PISTOLS);
}

Expand Down
16 changes: 8 additions & 8 deletions src/level.h
Original file line number Diff line number Diff line change
Expand Up @@ -809,6 +809,14 @@ struct Level : IGame {

Core::fogParams = TR::getFogParams(level.id);

inventory->game = this;

if (!level.isCutsceneLevel()) {
inventory->reset();
memset(&saveStats, 0, sizeof(saveStats));
saveStats.level = level.id;
}

initTextures();
mesh = new MeshBuilder(&level, atlas);
initOverrides();
Expand Down Expand Up @@ -862,14 +870,6 @@ struct Level : IGame {
}
*/

inventory->game = this;

if (!level.isCutsceneLevel()) {
inventory->reset();
memset(&saveStats, 0, sizeof(saveStats));
saveStats.level = level.id;
}

saveResult = SAVE_RESULT_SUCCESS;
if (loadSlot != -1 && saveSlots[loadSlot].getLevelID() == level.id) {
parseSaveSlot(saveSlots[loadSlot]);
Expand Down

0 comments on commit a9b73f0

Please sign in to comment.