Fixed internal Dehacked support

https://mantis.zdoom.org/view.php?id=619
This commit is contained in:
alexey.lysiuk 2017-04-22 22:58:45 +03:00
parent e4c73cfc5f
commit 173fa31383

View file

@ -2844,7 +2844,7 @@ static bool LoadDehSupp ()
sc.MustGetStringName(","); sc.MustGetStringName(",");
sc.MustGetNumber(); sc.MustGetNumber();
if (s.State == NULL || !actortype->OwnsState(s.State + sc.Number)) if (s.State == NULL || sc.Number < 1 || !actortype->OwnsState(s.State + sc.Number - 1))
{ {
sc.ScriptError("Invalid state range in '%s'", type->TypeName.GetChars()); sc.ScriptError("Invalid state range in '%s'", type->TypeName.GetChars());
} }