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

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());
} }