Skip to content

Commit

Permalink
bugifx
Browse files Browse the repository at this point in the history
  • Loading branch information
kgsws committed Jun 10, 2023
1 parent f151f0a commit 6a43154
Show file tree
Hide file tree
Showing 4 changed files with 19 additions and 2 deletions.
7 changes: 7 additions & 0 deletions engine/mobj.c
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,8 @@ static uint_fast8_t teleblock;
static fixed_t oldfloorz;
mobj_t *mobj_hit_thing;

uint16_t mobj_lock_sound;

//
// state changes

Expand Down Expand Up @@ -1732,12 +1734,17 @@ uint8_t *mobj_check_keylock(mobj_t *mo, uint32_t lockdef, uint32_t is_remote)
uint8_t *msg = NULL;
uint8_t *rsg = NULL;

mobj_lock_sound = 0;

while(ptr < lockdefs + lockdefs_size)
{
lockdef_t *ld = ptr;

if(ld->id == lockdef)
{
mobj_lock_sound = ld->sound;
data = ld->data;
}

ptr += ld->size;
}
Expand Down
2 changes: 2 additions & 0 deletions engine/mobj.h
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,8 @@ extern uint_fast8_t reborn_inventory_hack;

extern mobj_t *mobj_hit_thing;

extern uint16_t mobj_lock_sound;

//

void mobj_set_animation(mobj_t*,uint8_t) __attribute((regparm(2),no_caller_saved_registers));
Expand Down
1 change: 1 addition & 0 deletions engine/sound.c
Original file line number Diff line number Diff line change
Expand Up @@ -489,6 +489,7 @@ static void cb_sndseq(lumpinfo_t *li)
uint16_t do_stop;

tp_load_lump(li);
tp_enable_array = 1;

while(1)
{
Expand Down
11 changes: 9 additions & 2 deletions engine/special.c
Original file line number Diff line number Diff line change
Expand Up @@ -1883,8 +1883,15 @@ void spec_activate(line_t *ln, mobj_t *mo, uint32_t type)
message = mobj_check_keylock(spec_activator, spec_arg[3], spec_arg[0]);
if(message)
{
if(spec_activator->player && message[0])
spec_activator->player->message = message;
if(spec_activator->player)
{
if(message[0])
spec_activator->player->message = message;
if(!mobj_lock_sound)
mobj_lock_sound = mo->info->player.sound.usefail;
}
if(mobj_lock_sound)
S_StartSound(spec_activator, mobj_lock_sound);
value_mult = 0;
}
}
Expand Down

0 comments on commit 6a43154

Please sign in to comment.