Added compatibility parameter to set thing skills

# Conflicts:
#	src/compatibility.cpp
This commit is contained in:
alexey.lysiuk 2016-12-22 12:42:56 +02:00 committed by Christoph Oelckers
parent 9011f0ed5b
commit cd8aa252ae

View file

@ -87,6 +87,7 @@ enum
CP_SETTAG,
CP_SETTHINGFLAGS,
CP_SETVERTEX,
CP_SETTHINGSKILLS,
};
// EXTERNAL FUNCTION PROTOTYPES --------------------------------------------
@ -358,6 +359,15 @@ void ParseCompatibility()
CompatParams.Push(int(sc.Float * 256)); // do not use full fixed here so that it can eventually handle larger levels
flags.CompatFlags[SLOT_BCOMPAT] |= BCOMPATF_REBUILDNODES;
}
else if (sc.Compare("setthingskills"))
{
if (flags.ExtCommandIndex == ~0u) flags.ExtCommandIndex = CompatParams.Size();
CompatParams.Push(CP_SETTHINGSKILLS);
sc.MustGetNumber();
CompatParams.Push(sc.Number);
sc.MustGetNumber();
CompatParams.Push(sc.Number);
}
else
{
sc.UnGet();
@ -623,6 +633,15 @@ void SetCompatibilityParams()
i += 4;
break;
}
case CP_SETTHINGSKILLS:
{
if ((unsigned)CompatParams[i + 1] < MapThingsConverted.Size())
{
MapThingsConverted[CompatParams[i + 1]].SkillFilter = CompatParams[i + 2];
}
i += 3;
break;
}
}
}
}