Skip to content

Commit

Permalink
fix OG bug with illegal pistols equip (closes #30)
Browse files Browse the repository at this point in the history
  • Loading branch information
rr- committed Feb 27, 2021
1 parent ae8704b commit 6e5341e
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 1 deletion.
7 changes: 6 additions & 1 deletion Tomb1Main.json
Original file line number Diff line number Diff line change
Expand Up @@ -116,5 +116,10 @@

// Enables calculating the number of secrets based on a trigger count
// within a file rather than using hardcoded values.
"fix_hardcoded_secret_counts": true
"fix_hardcoded_secret_counts": true,

// Fixes ability to obtain pistols by running out of ammo with other guns.
// (Happens if you get to shotgun before obtaining pistols in Natla's
// Mines)
"fix_illegal_gun_equip": true
}
1 change: 1 addition & 0 deletions src/config.c
Original file line number Diff line number Diff line change
Expand Up @@ -115,6 +115,7 @@ int T1MReadConfig()
READ_BOOL(fix_tihocan_secret_sound);
READ_BOOL(fix_pyramid_secret_trigger);
READ_BOOL(fix_hardcoded_secret_counts);
READ_BOOL(fix_illegal_gun_equip);

T1MConfig.healthbar_showing_mode =
ReadBarShowingMode(json, "healthbar_showing_mode");
Expand Down
1 change: 1 addition & 0 deletions src/config.h
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,7 @@ struct {
int8_t fix_tihocan_secret_sound;
int8_t fix_pyramid_secret_trigger;
int8_t fix_hardcoded_secret_counts;
int8_t fix_illegal_gun_equip;
} T1MConfig;

int T1MReadConfig();
Expand Down
7 changes: 7 additions & 0 deletions src/game/larafire.c
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
#include "game/misc.h"
#include "game/sphere.h"
#include "game/vars.h"
#include "config.h"
#include "util.h"

void LaraGun()
Expand Down Expand Up @@ -415,7 +416,13 @@ int32_t FireWeapon(
if (ammo->ammo <= 0) {
ammo->ammo = 0;
SoundEffect(48, &src->pos, 0);
#ifdef T1M_FEAT_OG_FIXES
if (!T1MConfig.fix_illegal_gun_equip || Inv_RequestItem(O_GUN_ITEM)) {
Lara.request_gun_type = LGT_PISTOLS;
}
#else
Lara.request_gun_type = LGT_PISTOLS;
#endif
return 0;
}

Expand Down

0 comments on commit 6e5341e

Please sign in to comment.