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
1 changed files with 19 additions and 0 deletions

View File

@ -87,6 +87,7 @@ enum
CP_SETTAG, CP_SETTAG,
CP_SETTHINGFLAGS, CP_SETTHINGFLAGS,
CP_SETVERTEX, CP_SETVERTEX,
CP_SETTHINGSKILLS,
}; };
// EXTERNAL FUNCTION PROTOTYPES -------------------------------------------- // 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 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; 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 else
{ {
sc.UnGet(); sc.UnGet();
@ -623,6 +633,15 @@ void SetCompatibilityParams()
i += 4; i += 4;
break; break;
} }
case CP_SETTHINGSKILLS:
{
if ((unsigned)CompatParams[i + 1] < MapThingsConverted.Size())
{
MapThingsConverted[CompatParams[i + 1]].SkillFilter = CompatParams[i + 2];
}
i += 3;
break;
}
} }
} }
} }