Maintain category of edited existing thing's info

This commit is contained in:
spherallic 2024-05-28 15:54:36 +02:00
parent 1afa0b9e7b
commit c67e8dec89

View file

@ -12,7 +12,7 @@ namespace CodeImp.DoomBuilder.ZDoom
public sealed class LuaMobjStructure : ActorStructure
{
#region ================== DECORATE Actor Structure parsing
#region ================== Lua Actor Structure parsing
internal LuaMobjStructure(ZDTextParser zdparser, string objname, int editnum)
{
@ -31,7 +31,15 @@ namespace CodeImp.DoomBuilder.ZDoom
props["$title"] = new List<string> { objname };
if (editnum > 0)
{
Dictionary<int, ThingTypeInfo> thingtypes = General.Map.Config.GetThingTypes();
thingtypes.TryGetValue(editnum, out ThingTypeInfo ti);
if (ti != null)
{
doomednum = editnum;
props["category"] = new List<string>() { ti.Category.Title };
}
}
// Now parse the contents of actor structure