Removes LocalPlayer check from HideMapCrateAction and RevealMapCrateAction.
Fixes #9063. Fixes #9127.
This commit is contained in:
@@ -32,9 +32,7 @@ namespace OpenRA.Mods.Common.Traits
|
||||
|
||||
public override void Activate(Actor collector)
|
||||
{
|
||||
if (collector.Owner == collector.World.LocalPlayer)
|
||||
collector.Owner.Shroud.ResetExploration();
|
||||
|
||||
collector.Owner.Shroud.ResetExploration();
|
||||
base.Activate(collector);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -8,8 +8,6 @@
|
||||
*/
|
||||
#endregion
|
||||
|
||||
using OpenRA.Traits;
|
||||
|
||||
namespace OpenRA.Mods.Common.Traits
|
||||
{
|
||||
[Desc("Reveals the entire map.")]
|
||||
@@ -31,18 +29,15 @@ namespace OpenRA.Mods.Common.Traits
|
||||
this.info = info;
|
||||
}
|
||||
|
||||
bool ShouldReveal(Player collectingPlayer)
|
||||
{
|
||||
if (info.IncludeAllies)
|
||||
return collectingPlayer.World.LocalPlayer != null &&
|
||||
collectingPlayer.Stances[collectingPlayer.World.LocalPlayer] == Stance.Ally;
|
||||
|
||||
return collectingPlayer == collectingPlayer.World.LocalPlayer;
|
||||
}
|
||||
|
||||
public override void Activate(Actor collector)
|
||||
{
|
||||
if (ShouldReveal(collector.Owner))
|
||||
if (info.IncludeAllies)
|
||||
{
|
||||
foreach (var player in collector.World.Players)
|
||||
if (collector.Owner.IsAlliedWith(player))
|
||||
player.Shroud.ExploreAll(player.World);
|
||||
}
|
||||
else
|
||||
collector.Owner.Shroud.ExploreAll(collector.World);
|
||||
|
||||
base.Activate(collector);
|
||||
|
||||
Reference in New Issue
Block a user