- added: Let the kill CCMD also kill replacements of the monster that is specified.

- add a GetReplacement method to PClass to clean up some really ugly code
- Who wrote the 'kill' CCMD? The way it checked if two classes were identical was horrendously overcomplicated.

SVN r2601 (trunk)
This commit is contained in:
Christoph Oelckers 2010-08-26 20:59:15 +00:00
commit 9102200771
10 changed files with 40 additions and 19 deletions

View file

@ -754,8 +754,8 @@ void cht_Give (player_t *player, const char *name, int amount)
// Don't give replaced weapons unless the replacement was done by Dehacked.
if (type != RUNTIME_CLASS(AWeapon) &&
type->IsDescendantOf (RUNTIME_CLASS(AWeapon)) &&
(type->ActorInfo->GetReplacement() == type->ActorInfo ||
type->ActorInfo->GetReplacement()->Class->IsDescendantOf(RUNTIME_CLASS(ADehackedPickup))))
(type->GetReplacement() == type ||
type->GetReplacement()->IsDescendantOf(RUNTIME_CLASS(ADehackedPickup))))
{
// Give the weapon only if it belongs to the current game or