- Added Gez's MageWandMissile customization patch but moved the new functionality

into the FastProjectile base class and removed the native MageWandMissile
  class, using the generic functionality instead.
- Fixed: GetReplacement and GetReplacee always checked the skill definitions,
  even if they weren't supposed to be used. It was also missing a range check
  for 'gameskill'.


SVN r1894 (trunk)
This commit is contained in:
Christoph Oelckers 2009-10-03 17:07:11 +00:00
commit 3d8d176087
7 changed files with 60 additions and 51 deletions

View file

@ -168,17 +168,22 @@ void FActorInfo::RegisterIDs ()
FActorInfo *FActorInfo::GetReplacement (bool lookskill)
{
FName skillrepname = AllSkills[gameskill].GetReplacement(this->Class->TypeName);
if (skillrepname != NAME_None && PClass::FindClass(skillrepname) == NULL)
FName skillrepname;
if (lookskill && AllSkills.Size() > (unsigned)gameskill)
{
Printf("Warning: incorrect actor name in definition of skill %s: \n\
class %s is replaced by inexistent class %s\n\
Skill replacement will be ignored for this actor.\n",
AllSkills[gameskill].Name.GetChars(),
this->Class->TypeName.GetChars(), skillrepname.GetChars());
AllSkills[gameskill].SetReplacement(this->Class->TypeName, NAME_None);
AllSkills[gameskill].SetReplacedBy(skillrepname, NAME_None);
lookskill = false; skillrepname = NAME_None;
skillrepname = AllSkills[gameskill].GetReplacement(this->Class->TypeName);
if (skillrepname != NAME_None && PClass::FindClass(skillrepname) == NULL)
{
Printf("Warning: incorrect actor name in definition of skill %s: \n"
"class %s is replaced by non-existent class %s\n"
"Skill replacement will be ignored for this actor.\n",
AllSkills[gameskill].Name.GetChars(),
this->Class->TypeName.GetChars(), skillrepname.GetChars());
AllSkills[gameskill].SetReplacement(this->Class->TypeName, NAME_None);
AllSkills[gameskill].SetReplacedBy(skillrepname, NAME_None);
lookskill = false; skillrepname = NAME_None;
}
}
if (Replacement == NULL && (!lookskill || skillrepname == NAME_None))
{
@ -211,17 +216,22 @@ FActorInfo *FActorInfo::GetReplacement (bool lookskill)
FActorInfo *FActorInfo::GetReplacee (bool lookskill)
{
FName skillrepname = AllSkills[gameskill].GetReplacedBy(this->Class->TypeName);
if (skillrepname != NAME_None && PClass::FindClass(skillrepname) == NULL)
FName skillrepname;
if (lookskill && AllSkills.Size() > (unsigned)gameskill)
{
Printf("Warning: incorrect actor name in definition of skill %s: \
inexistent class %s is replaced by class %s\n\
Skill replacement will be ignored for this actor.\n",
AllSkills[gameskill].Name.GetChars(),
skillrepname.GetChars(), this->Class->TypeName.GetChars());
AllSkills[gameskill].SetReplacedBy(this->Class->TypeName, NAME_None);
AllSkills[gameskill].SetReplacement(skillrepname, NAME_None);
lookskill = false;
FName skillrepname = AllSkills[gameskill].GetReplacedBy(this->Class->TypeName);
if (skillrepname != NAME_None && PClass::FindClass(skillrepname) == NULL)
{
Printf("Warning: incorrect actor name in definition of skill %s: \n"
"non-existent class %s is replaced by class %s\n"
"Skill replacement will be ignored for this actor.\n",
AllSkills[gameskill].Name.GetChars(),
skillrepname.GetChars(), this->Class->TypeName.GetChars());
AllSkills[gameskill].SetReplacedBy(this->Class->TypeName, NAME_None);
AllSkills[gameskill].SetReplacement(skillrepname, NAME_None);
lookskill = false;
}
}
if (Replacee == NULL && (!lookskill || skillrepname == NAME_None))
{