Clean up usage of DomainIndex
- When a path search is being performed the path search will not attempt route to inaccessible cells, so domain index checks to avoid inaccessible cells in the search predicate are redundant and can be removed. - DomainIndex is a required world trait, so we don't need to use TraitOrDefault and therefore can avoid dealing with the null case.
This commit is contained in:
committed by
Matthias Mailänder
parent
4b4b0125a2
commit
2ab3917f29
@@ -25,12 +25,9 @@ namespace OpenRA.Mods.Common.Scripting
|
||||
[ScriptGlobal("Reinforcements")]
|
||||
public class ReinforcementsGlobal : ScriptGlobal
|
||||
{
|
||||
readonly DomainIndex domainIndex;
|
||||
|
||||
public ReinforcementsGlobal(ScriptContext context)
|
||||
: base(context)
|
||||
{
|
||||
domainIndex = context.World.WorldActor.Trait<DomainIndex>();
|
||||
}
|
||||
|
||||
Actor CreateActor(Player owner, string actorType, bool addToWorld, CPos? entryLocation = null, CPos? nextLocation = null)
|
||||
|
||||
Reference in New Issue
Block a user