Actually, I've discovered this bug few months ago while testing
related code submission (now quietly rotting in development limbo,sadly) - in my case it was the fact that random spawner was not respecting multiplayer only weapon spawning. I examined the issue and found solution - check original replaced actor instead of replacee,like this:
Code: Select all
// [RH] don't spawn extra weapons in coop if so desired
if (multiplayer && !deathmatch && (dmflags & DF_NO_COOP_WEAPON_SPAWN))
{
if (i->IsDescendantOf (RUNTIME_CLASS(AWeapon)))
{
if ((mthing->flags & (MTF_DEATHMATCH|MTF_SINGLE)) == MTF_DEATHMATCH)
return NULL;
}
}
>>>
Code: Select all
// [RH] don't spawn extra weapons in coop if so desired
if (multiplayer && !deathmatch && (dmflags & DF_NO_COOP_WEAPON_SPAWN))
{
if (i->ActorInfo->GetReplacee()->Class->IsDescendantOf (RUNTIME_CLASS(AWeapon)))
{
if ((mthing->flags & (MTF_DEATHMATCH|MTF_SINGLE)) == MTF_DEATHMATCH)
return NULL;
}
}
I was about to post it, when I realized it's only tip of the iceberg, there are many cases where problems could manifest, so complete solution must be well-thought and consistent.
In short, IsDescendantOf() check is not always sufficient for determining if given spawning filter should apply. For weapons, there are randomspawners, custom/fakeinventory or even pure actors with ACS magic, all not derived from AWeapon. Same goes for health and monsters. Considering that replace system is so permissive that you can replace stimpacks with cyberdemons, question arise about how spawn filters should work - based on replaced object,or replacee?
(Of course, one can argue that replacing health with monster is stupid in the first place, but some magic wasp that flies around, attack player and can be picked up for health is reasonable idea.)
There are several dmflags-based spawn filters and all should be reevaluated - I had other priorities before, but now that someone else noticed this issue, let's discuss it.
"No monsters" probably should catch all monsters, no matter what they replace, but items, big items, health, armor and powerups are up to debate.
Example,in case the problem is not clear:
Should "Allow armor" affect actors only derived from AArmor? Then what about all armor replacements that replaces actual armor pickup but aren't like that? CustomInventory,Health,everything is possible really... If check is based on what original actor was, it catches all these cases ... but it misses case when some other actor type is replaced with something derived from AArmor. Combining both tests? But when some crazy person replaces armor with imps, should this filter still apply?
As you can see they're not trivial questions, that's why I wasn't eager to deal with this before.