From e98c2eef689bd31bf8f54a4466b14cb5ccf5a7a6 Mon Sep 17 00:00:00 2001 From: Paul Chote Date: Sat, 4 Mar 2017 00:02:51 +0000 Subject: [PATCH] Fix invalid Transform location exploit. --- OpenRA.Mods.Common/Traits/Transforms.cs | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/OpenRA.Mods.Common/Traits/Transforms.cs b/OpenRA.Mods.Common/Traits/Transforms.cs index 9a9820e98b..da93479c40 100644 --- a/OpenRA.Mods.Common/Traits/Transforms.cs +++ b/OpenRA.Mods.Common/Traits/Transforms.cs @@ -138,6 +138,12 @@ namespace OpenRA.Mods.Common.Traits Faction = faction }; + // Try and stop the actor from doing anything between the sanity checks above + // and the actual transform, which we're about to queue. + // TODO: The proper way to do this is to write all the transform code as a nested activity. + if (self.CurrentActivity.NextInQueue != null) + self.CurrentActivity.NextInQueue.Cancel(self); + var makeAnimation = self.TraitOrDefault(); if (makeAnimation != null) makeAnimation.Reverse(self, transform);