- Fixed: Redefining an existing skill would set that skills ACSReturn to be
the same as the next new skill defined, if neither definition explicitly set the value for ACSReturn. - Added a DefaultSkill property. Adding it to a skill will cause that skill to be the default one selected in the menu. If none is specified as the default, then the middle skill is the default. SVN r1731 (trunk)
This commit is contained in:
parent
dba34d0761
commit
8a2e03c9cb
10 changed files with 64 additions and 12 deletions
|
|
@ -42,6 +42,7 @@
|
|||
#include "v_font.h"
|
||||
|
||||
TArray<FSkillInfo> AllSkills;
|
||||
int DefaultSkill = -1;
|
||||
|
||||
//==========================================================================
|
||||
//
|
||||
|
|
@ -52,6 +53,8 @@ TArray<FSkillInfo> AllSkills;
|
|||
void FMapInfoParser::ParseSkill ()
|
||||
{
|
||||
FSkillInfo skill;
|
||||
bool thisisdefault = false;
|
||||
bool acsreturnisset = false;
|
||||
|
||||
skill.AmmoFactor = FRACUNIT;
|
||||
skill.DoubleAmmoFactor = 2*FRACUNIT;
|
||||
|
|
@ -65,7 +68,7 @@ void FMapInfoParser::ParseSkill ()
|
|||
skill.RespawnLimit = 0;
|
||||
skill.Aggressiveness = FRACUNIT;
|
||||
skill.SpawnFilter = 0;
|
||||
skill.ACSReturn = AllSkills.Size();
|
||||
skill.ACSReturn = 0;
|
||||
skill.MenuNameIsLump = false;
|
||||
skill.MustConfirm = false;
|
||||
skill.Shortcut = 0;
|
||||
|
|
@ -163,6 +166,7 @@ void FMapInfoParser::ParseSkill ()
|
|||
ParseAssign();
|
||||
sc.MustGetNumber ();
|
||||
skill.ACSReturn = sc.Number;
|
||||
acsreturnisset = true;
|
||||
}
|
||||
else if (sc.Compare("ReplaceActor"))
|
||||
{
|
||||
|
|
@ -245,6 +249,14 @@ void FMapInfoParser::ParseSkill ()
|
|||
{
|
||||
skill.NoPain = true;
|
||||
}
|
||||
else if (sc.Compare("DefaultSkill"))
|
||||
{
|
||||
if (DefaultSkill >= 0)
|
||||
{
|
||||
sc.ScriptError("%s is already the default skill\n", AllSkills[DefaultSkill].Name.GetChars());
|
||||
}
|
||||
thisisdefault = true;
|
||||
}
|
||||
else if (!ParseCloseBrace())
|
||||
{
|
||||
// Unknown
|
||||
|
|
@ -261,10 +273,26 @@ void FMapInfoParser::ParseSkill ()
|
|||
{
|
||||
if (AllSkills[i].Name == skill.Name)
|
||||
{
|
||||
if (!acsreturnisset)
|
||||
{ // Use the ACS return for the skill we are overwriting.
|
||||
skill.ACSReturn = AllSkills[i].ACSReturn;
|
||||
}
|
||||
AllSkills[i] = skill;
|
||||
if (thisisdefault)
|
||||
{
|
||||
DefaultSkill = i;
|
||||
}
|
||||
return;
|
||||
}
|
||||
}
|
||||
if (!acsreturnisset)
|
||||
{
|
||||
skill.ACSReturn = AllSkills.Size();
|
||||
}
|
||||
if (thisisdefault)
|
||||
{
|
||||
DefaultSkill = AllSkills.Size();
|
||||
}
|
||||
AllSkills.Push(skill);
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue