- Fixed: S_StopSound may not assume that after stopping a sound channel

its link to the next item in the list is still valid.
- Fixed typo in src/CMakeLists.txt.
- Fixed: Armor only worked for players.


SVN r1489 (trunk)
This commit is contained in:
Christoph Oelckers 2009-03-19 22:48:55 +00:00
parent ca454bfeb3
commit 18b4577bbd
4 changed files with 37 additions and 6 deletions

View file

@ -1,4 +1,8 @@
March 18, 2009 (Changes by Graf Zahl) March 18, 2009 (Changes by Graf Zahl)
- Fixed: S_StopSound may not assume that after stopping a sound channel
its link to the next item in the list is still valid.
- Fixed typo in src/CMakeLists.txt.
- Fixed: Armor only worked for players.
- Fixed: P_FindFloorCeiling may not call P_PointInSector if called from - Fixed: P_FindFloorCeiling may not call P_PointInSector if called from
P_SpawnMapThing. It must use the values the actor has been initialized to P_SpawnMapThing. It must use the values the actor has been initialized to
by LinkToWorldForMapThing. by LinkToWorldForMapThing.

View file

@ -42,7 +42,7 @@ foreach( majver ${MAJOR_VERSIONS} )
set( FMOD_LOCAL_INC_DIRS ${FMOD_LOCAL_INC_DIRS} "${dir}/api/inc" ) set( FMOD_LOCAL_INC_DIRS ${FMOD_LOCAL_INC_DIRS} "${dir}/api/inc" )
set( FMOD_LOCAL_LIB_DIRS ${FMOD_LOCAL_LIB_DIRS} "${dir}/api/lib" ) set( FMOD_LOCAL_LIB_DIRS ${FMOD_LOCAL_LIB_DIRS} "${dir}/api/lib" )
endforeach( dir ${FMOD_DIR_VERSIONS} ) endforeach( dir ${FMOD_DIR_VERSIONS} )
endforeach( majver ${MAJER_VERSIONS} ) endforeach( majver ${MAJOR_VERSIONS} )
if( WIN32 ) if( WIN32 )
if( X64 ) if( X64 )

View file

@ -1155,6 +1155,18 @@ void P_DamageMobj (AActor *target, AActor *inflictor, AActor *source, int damage
} }
else else
{ {
// Armor for monsters.
if (!(flags & DMG_NO_ARMOR) && target->Inventory != NULL)
{
int newdam = damage;
target->Inventory->AbsorbDamage (damage, mod, newdam);
damage = newdam;
if (damage <= 0)
{
return;
}
}
target->health -= damage; target->health -= damage;
} }

View file

@ -1369,13 +1369,16 @@ bool S_CheckSoundLimit(sfxinfo_t *sfx, const FVector3 &pos, int near_limit, floa
void S_StopSound (int channel) void S_StopSound (int channel)
{ {
for (FSoundChan *chan = Channels; chan != NULL; chan = chan->NextChan) FSoundChan *chan = Channels;
while (chan != NULL)
{ {
FSoundChan *next = chan->NextChan;
if (chan->SourceType == SOURCE_None && if (chan->SourceType == SOURCE_None &&
(chan->EntChannel == channel || (i_compatflags & COMPATF_MAGICSILENCE))) (chan->EntChannel == channel || (i_compatflags & COMPATF_MAGICSILENCE)))
{ {
S_StopChannel(chan); S_StopChannel(chan);
} }
chan = next;
} }
} }
@ -1389,14 +1392,17 @@ void S_StopSound (int channel)
void S_StopSound (AActor *actor, int channel) void S_StopSound (AActor *actor, int channel)
{ {
for (FSoundChan *chan = Channels; chan != NULL; chan = chan->NextChan) FSoundChan *chan = Channels;
while (chan != NULL)
{ {
FSoundChan *next = chan->NextChan;
if (chan->SourceType == SOURCE_Actor && if (chan->SourceType == SOURCE_Actor &&
chan->Actor == actor && chan->Actor == actor &&
(chan->EntChannel == channel || (i_compatflags & COMPATF_MAGICSILENCE))) (chan->EntChannel == channel || (i_compatflags & COMPATF_MAGICSILENCE)))
{ {
S_StopChannel(chan); S_StopChannel(chan);
} }
chan = next;
} }
} }
@ -1410,14 +1416,17 @@ void S_StopSound (AActor *actor, int channel)
void S_StopSound (const sector_t *sec, int channel) void S_StopSound (const sector_t *sec, int channel)
{ {
for (FSoundChan *chan = Channels; chan != NULL; chan = chan->NextChan) FSoundChan *chan = Channels;
while (chan != NULL)
{ {
FSoundChan *next = chan->NextChan;
if (chan->SourceType == SOURCE_Sector && if (chan->SourceType == SOURCE_Sector &&
chan->Sector == sec && chan->Sector == sec &&
(chan->EntChannel == channel || (i_compatflags & COMPATF_MAGICSILENCE))) (chan->EntChannel == channel || (i_compatflags & COMPATF_MAGICSILENCE)))
{ {
S_StopChannel(chan); S_StopChannel(chan);
} }
chan = next;
} }
} }
@ -1431,14 +1440,17 @@ void S_StopSound (const sector_t *sec, int channel)
void S_StopSound (const FPolyObj *poly, int channel) void S_StopSound (const FPolyObj *poly, int channel)
{ {
for (FSoundChan *chan = Channels; chan != NULL; chan = chan->NextChan) FSoundChan *chan = Channels;
while (chan != NULL)
{ {
FSoundChan *next = chan->NextChan;
if (chan->SourceType == SOURCE_Polyobj && if (chan->SourceType == SOURCE_Polyobj &&
chan->Poly == poly && chan->Poly == poly &&
(chan->EntChannel == channel || (i_compatflags & COMPATF_MAGICSILENCE))) (chan->EntChannel == channel || (i_compatflags & COMPATF_MAGICSILENCE)))
{ {
S_StopChannel(chan); S_StopChannel(chan);
} }
chan = next;
} }
} }
@ -1475,8 +1487,10 @@ void S_RelinkSound (AActor *from, AActor *to)
if (from == NULL) if (from == NULL)
return; return;
for (FSoundChan *chan = Channels; chan != NULL; chan = chan->NextChan) FSoundChan *chan = Channels;
while (chan != NULL)
{ {
FSoundChan *next = chan->NextChan;
if (chan->SourceType == SOURCE_Actor && chan->Actor == from) if (chan->SourceType == SOURCE_Actor && chan->Actor == from)
{ {
if (to != NULL) if (to != NULL)
@ -1496,6 +1510,7 @@ void S_RelinkSound (AActor *from, AActor *to)
S_StopChannel(chan); S_StopChannel(chan);
} }
} }
chan = next;
} }
} }