Skip to content

Commit

Permalink
Fix bi checks in Production lua.
Browse files Browse the repository at this point in the history
  • Loading branch information
MustaphaTR committed Aug 23, 2023
1 parent 118a095 commit 6a9ac4d
Showing 1 changed file with 3 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -194,12 +194,13 @@ public bool IsProducing(string actorType)
BuildableInfo GetBuildableInfo(string actorType, string queue)
{
var ri = Self.World.Map.Rules.Actors[actorType];
var bi = BuildableInfo.GetTraitForQueue(ri, queue);
var bi = ri.TraitInfos<BuildableInfo>().FirstOrDefault();

// Error if there are no Buildable traits, return correct one otherwise.
if (bi == null)
throw new LuaException($"Actor of type {actorType} cannot be produced");
else
return bi;
return BuildableInfo.GetTraitForQueue(ri, queue);
}
}

Expand Down

0 comments on commit 6a9ac4d

Please sign in to comment.