Skip to content

Commit

Permalink
Heretic/Hexen: stability fixes
Browse files Browse the repository at this point in the history
Incorrect list management and code not intended for client-side.
  • Loading branch information
skyjake committed Aug 4, 2011
1 parent 25272b5 commit d2fba80
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 7 deletions.
6 changes: 4 additions & 2 deletions doomsday/plugins/common/src/p_map.c
Expand Up @@ -2679,6 +2679,9 @@ boolean PIT_ChangeSector(mobj_t* thing, void* data)
{
mobj_t* mo;

if(!thing->info)
return true; // Invalid thing?

// Don't check things that aren't blocklinked (supposedly immaterial).
if(thing->info->flags & MF_NOBLOCKMAP)
return true;
Expand Down Expand Up @@ -2836,8 +2839,7 @@ static void CheckMissileImpact(mobj_t* mobj)
int size;
linedef_t* ld;

if(!mobj->target || !mobj->target->player ||
!(mobj->flags & MF_MISSILE))
if(IS_CLIENT || !mobj->target || !mobj->target->player || !(mobj->flags & MF_MISSILE))
return;

if(!(size = IterList_Size(spechit)))
Expand Down
15 changes: 10 additions & 5 deletions doomsday/plugins/jhexen/src/sn_sonix.c
Expand Up @@ -278,7 +278,7 @@ void SN_StartSequence(mobj_t* mobj, int sequence)
seqnode_t* node;

SN_StopSequence(mobj); // Stop any previous sequence
node = Z_Malloc(sizeof(seqnode_t), PU_STATIC, NULL);
node = Z_Calloc(sizeof(seqnode_t), PU_STATIC, NULL);
node->sequencePtr = SequenceData[SequenceTranslate[sequence].scriptNum];
node->sequence = sequence;
node->mobj = mobj;
Expand Down Expand Up @@ -328,10 +328,13 @@ void SN_StartSequenceName(mobj_t* mobj, const char* name)

void SN_StopSequence(mobj_t* mobj)
{
seqnode_t* node;
seqnode_t* node;
seqnode_t* next = 0;

for(node = SequenceListHead; node; node = node->next)
for(node = SequenceListHead; node; node = next)
{
next = node->next;

if(node->mobj == mobj)
{
S_StopSound(0, mobj);
Expand Down Expand Up @@ -468,10 +471,12 @@ Con_Printf("REPT: id=%i, %s: %p\n", node->currentSoundID,

void SN_StopAllSequences(void)
{
seqnode_t* node;
seqnode_t* node;
seqnode_t* next = 0;

for(node = SequenceListHead; node; node = node->next)
for(node = SequenceListHead; node; node = next)
{
next = node->next;
node->stopSound = 0; // don't play any stop sounds
SN_StopSequence(node->mobj);
}
Expand Down

0 comments on commit d2fba80

Please sign in to comment.