Fix spice debris target cell randomization
This commit is contained in:
@@ -91,21 +91,6 @@ namespace OpenRA.Mods.D2k.Traits
|
||||
|
||||
public void Killed(Actor self, AttackInfo e)
|
||||
{
|
||||
var args = new ProjectileArgs
|
||||
{
|
||||
Weapon = self.World.Map.Rules.Weapons[info.Weapon.ToLowerInvariant()],
|
||||
Facing = 0,
|
||||
|
||||
DamageModifiers = self.TraitsImplementing<IFirepowerModifier>()
|
||||
.Select(a => a.GetFirepowerModifier()).ToArray(),
|
||||
|
||||
InaccuracyModifiers = self.TraitsImplementing<IInaccuracyModifier>()
|
||||
.Select(a => a.GetInaccuracyModifier()).ToArray(),
|
||||
|
||||
Source = self.CenterPosition,
|
||||
SourceActor = self,
|
||||
};
|
||||
|
||||
var pieces = self.World.SharedRandom.Next(info.Pieces[0], info.Pieces[1]) * ticks / growTicks;
|
||||
for (var i = 0; pieces > i; i++)
|
||||
{
|
||||
@@ -114,7 +99,21 @@ namespace OpenRA.Mods.D2k.Traits
|
||||
if (cell == null)
|
||||
cell = cells.Take(info.Range).Random(self.World.SharedRandom);
|
||||
|
||||
args.PassiveTarget = self.World.Map.CenterOfCell(cell.Value);
|
||||
var args = new ProjectileArgs
|
||||
{
|
||||
Weapon = self.World.Map.Rules.Weapons[info.Weapon.ToLowerInvariant()],
|
||||
Facing = 0,
|
||||
|
||||
DamageModifiers = self.TraitsImplementing<IFirepowerModifier>()
|
||||
.Select(a => a.GetFirepowerModifier()).ToArray(),
|
||||
|
||||
InaccuracyModifiers = self.TraitsImplementing<IInaccuracyModifier>()
|
||||
.Select(a => a.GetInaccuracyModifier()).ToArray(),
|
||||
|
||||
Source = self.CenterPosition,
|
||||
SourceActor = self,
|
||||
PassiveTarget = self.World.Map.CenterOfCell(cell.Value)
|
||||
};
|
||||
|
||||
self.World.AddFrameEndTask(_ =>
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user