MODELDEF parser: fixed a crash when trying to add a model definition when another one was already created for the same actor.

ZDoom_DECORATE.cfg: added A_SetSpeed definition.
This commit is contained in:
MaxED 2014-09-22 00:16:42 +00:00
parent 786caf3b34
commit e6b997a7da
2 changed files with 8 additions and 1 deletions

View file

@ -167,6 +167,7 @@ keywords
A_SetShootable = "A_SetShootable";
A_SetSolid = "A_SetSolid";
A_SetSpecial = "A_SetSpecial(int special, int arg0, int arg1, int arg2, int arg3, int arg4)";
A_SetSpeed = "A_SetSpeed(float speed)";
A_SetTics = "A_SetTics(int tics)";
A_SetTranslucent = "A_SetTranslucent(float alpha, int mode)";
A_SetUserVar = "A_SetUserVar(string name, int value)";

View file

@ -1492,7 +1492,13 @@ namespace CodeImp.DoomBuilder.Data
// Parse the data
if(parser.Parse(group.Value, currentreader.Location.location + "\\" + group.Key)) {
foreach(KeyValuePair<string, ModelData> g in parser.Entries) {
modelDefEntriesByName.Add(g.Key, g.Value);
if (modelDefEntriesByName.ContainsKey(g.Key)) {
General.ErrorLogger.Add(ErrorType.Warning, "Model definition for actor '" + g.Key + "' is double-defined in '" + group.Key + "'");
modelDefEntriesByName[g.Key] = g.Value;
} else {
modelDefEntriesByName.Add(g.Key, g.Value);
}
}
}
}