fix secret sound playing incorrectly in Tihocan

This commit is contained in:
rr- 2021-02-13 19:39:56 +01:00
parent afd07eb1b3
commit 8763e90ec7
5 changed files with 19 additions and 7 deletions

View file

@ -32,6 +32,8 @@ Currently the following configuration options are supported:
etc. (similar to TR2 style).
- `fix_end_of_level_freeze`: fix game freeze when ending the level with the
Action key held.
- `fix_tihocan_secret_sound`: disable the secret sound incorrectly playing
during using the golden key in Tomb of Tihocan.
## Decompilation progress

View file

@ -7,5 +7,6 @@
"enable_red_healthbar": true,
"enable_enemy_healthbar": true,
"enable_look_while_running": true,
"fix_end_of_level_freeze": true
"fix_end_of_level_freeze": true,
"fix_tihocan_secret_sound": true
}

View file

@ -1,16 +1,22 @@
#include "data.h"
#include "effects.h"
#include "mod.h"
void __cdecl FxChainBlock(ITEM_INFO* item)
{
if (FlipTimer == 0) {
SoundEffect(173, NULL, 0);
}
FlipTimer++;
if (FlipTimer == 55) {
if (TR1MConfig.fix_tihocan_secret_sound) {
SoundEffect(33, NULL, 0);
FlipEffect = -1;
} else {
if (FlipTimer == 0) {
SoundEffect(173, NULL, 0);
}
FlipTimer++;
if (FlipTimer == 55) {
SoundEffect(33, NULL, 0);
FlipEffect = -1;
}
}
}

View file

@ -71,6 +71,8 @@ static int TR1MReadConfig()
tr1m_json_get_boolean_value(json, "enable_look_while_running");
TR1MConfig.fix_end_of_level_freeze =
tr1m_json_get_boolean_value(json, "fix_end_of_level_freeze");
TR1MConfig.fix_tihocan_secret_sound =
tr1m_json_get_boolean_value(json, "fix_tihocan_secret_sound");
json_value_free(json);
free(cfg_data);

View file

@ -20,6 +20,7 @@ struct {
int enable_enemy_healthbar;
int enable_look_while_running;
int fix_end_of_level_freeze;
int fix_tihocan_secret_sound;
} TR1MConfig;
struct {