Skip to content

Commit e28b7f2

Browse files
authored
Merge branch 'OpenRA:bleed' into chore/minimal-devcontainer
2 parents b5cc83f + 85c8f6c commit e28b7f2

File tree

11 files changed

+31
-16
lines changed

11 files changed

+31
-16
lines changed

OpenRA.Game/OpenRA.Game.csproj

+1-1
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
<PackageReference Include="System.Collections.Immutable" Version="6.0.0" />
1111
</ItemGroup>
1212
<ItemGroup>
13-
<PackageReference Include="Linguini.Bundle" Version="0.5.0" />
13+
<PackageReference Include="Linguini.Bundle" Version="0.6.0" />
1414
<PackageReference Include="OpenRA-Eluant" Version="1.0.22" />
1515
<PackageReference Include="Mono.NAT" Version="3.0.4" />
1616
<PackageReference Include="SharpZipLib" Version="1.4.2" />

OpenRA.Mods.Common/Activities/UnloadCargo.cs

+2-1
Original file line numberDiff line numberDiff line change
@@ -119,11 +119,12 @@ public override bool Tick(Actor self)
119119

120120
var move = actor.Trait<IMove>();
121121
var pos = actor.Trait<IPositionable>();
122+
var passenger = actor.Trait<Passenger>();
122123

123124
pos.SetPosition(actor, exitSubCell.Value.Cell, exitSubCell.Value.SubCell);
124125
pos.SetCenterPosition(actor, spawn);
125126

126-
actor.CancelActivity();
127+
passenger.OnBeforeAddedToWorld(actor);
127128
w.Add(actor);
128129
});
129130
}

OpenRA.Mods.Common/Scripting/Global/ReinforcementsGlobal.cs

+1-1
Original file line numberDiff line numberDiff line change
@@ -157,7 +157,7 @@ public LuaTable ReinforceWithTransport(Player owner, string actorType, string[]
157157
// Scripted cargo aircraft must turn to default position before unloading.
158158
// TODO: pass facing through UnloadCargo instead.
159159
if (aircraft != null)
160-
transport.QueueActivity(new Land(transport, Target.FromCell(transport.World, entryPath.Last()), WDist.FromCells(dropRange), aircraft.Info.InitialFacing));
160+
transport.QueueActivity(new Land(transport, Target.FromCell(transport.World, entryPath.Last()), WDist.FromCells(dropRange)));
161161

162162
if (cargo != null)
163163
transport.QueueActivity(new UnloadCargo(transport, WDist.FromCells(dropRange)));

OpenRA.Mods.Common/Scripting/LuaScript.cs

+1-1
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ namespace OpenRA.Mods.Common.Scripting
2020
{
2121
[TraitLocation(SystemActors.World)]
2222
[Desc("Part of the new Lua API.")]
23-
public class LuaScriptInfo : TraitInfo, Requires<SpawnMapActorsInfo>
23+
public class LuaScriptInfo : TraitInfo, Requires<SpawnMapActorsInfo>, NotBefore<SpawnStartingUnitsInfo>
2424
{
2525
[Desc("File names with location relative to the map.")]
2626
public readonly HashSet<string> Scripts = new();

OpenRA.Mods.Common/Traits/AutoCrusher.cs

+1-1
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ void INotifyIdle.TickIdle(Actor self)
6363
self.Location != a.Location && a.IsAtGroundLevel() &&
6464
Info.TargetRelationships.HasRelationship(self.Owner.RelationshipWith(a.Owner)) &&
6565
a.TraitsImplementing<ICrushable>().Any(c => c.CrushableBy(a, self, Info.CrushClasses)))
66-
.ClosestToWithPathFrom(self); // TODO: Make it use shortest pathfinding distance instead
66+
.ClosestToWithPathFrom(self);
6767

6868
if (crushableActor == null)
6969
return;

OpenRA.Mods.Common/Traits/Cargo.cs

+1-2
Original file line numberDiff line numberDiff line change
@@ -428,8 +428,7 @@ void INotifyKilled.Killed(Actor self, AttackInfo e)
428428
foreach (var nbm in nbms)
429429
nbm.OnNotifyBlockingMove(passenger, passenger);
430430

431-
// For show.
432-
passenger.QueueActivity(new Nudge(passenger));
431+
passenger.Trait<Passenger>().OnEjectedFromKilledCargo(passenger);
433432
}
434433
else
435434
passenger.Kill(e.Attacker);

OpenRA.Mods.Common/Traits/Conditions/GrantConditionOnDeployWithCharge.cs

+1-1
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
namespace OpenRA.Mods.Common.Traits
1919
{
2020
[Desc("Allow deploying on specified charge to grant a condition for a specified duration.")]
21-
public class GrantConditionOnDeployWithChargeInfo : PausableConditionalTraitInfo, Requires<IMoveInfo>, IRulesetLoaded
21+
public class GrantConditionOnDeployWithChargeInfo : PausableConditionalTraitInfo, IRulesetLoaded
2222
{
2323
[FieldLoader.Require]
2424
[GrantedConditionReference]

OpenRA.Mods.Common/Traits/FireWarheads.cs

+3-6
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
namespace OpenRA.Mods.Common.Traits
1818
{
1919
[Desc("Detonate defined warheads at the current location at a set interval.")]
20-
public class FireWarheadsInfo : PausableConditionalTraitInfo, Requires<IMoveInfo>, IRulesetLoaded
20+
public class FireWarheadsInfo : PausableConditionalTraitInfo, Requires<IOccupySpaceInfo>, IRulesetLoaded
2121
{
2222
[WeaponReference]
2323
[FieldLoader.Require]
@@ -72,11 +72,8 @@ void ITick.Tick(Actor self)
7272
foreach (var wep in Info.WeaponInfos)
7373
{
7474
wep.Impact(Target.FromPos(self.CenterPosition), self);
75-
self.World.AddFrameEndTask(world =>
76-
{
77-
if (wep.Report != null && wep.Report.Length > 0)
78-
Game.Sound.Play(SoundType.World, wep.Report, world, self.CenterPosition);
79-
});
75+
if (wep.Report != null && wep.Report.Length > 0)
76+
Game.Sound.Play(SoundType.World, wep.Report, self.World, self.CenterPosition);
8077
}
8178
}
8279
}

OpenRA.Mods.Common/Traits/Passenger.cs

+13
Original file line numberDiff line numberDiff line change
@@ -207,6 +207,19 @@ public void Unreserve(Actor self)
207207
ReservedCargo = null;
208208
}
209209

210+
public virtual void OnBeforeAddedToWorld(Actor actor)
211+
{
212+
actor.CancelActivity();
213+
}
214+
215+
public virtual void OnEjectedFromKilledCargo(Actor self)
216+
{
217+
// Cancel all other activities to keep consistent behavior with the one in UnloadCargo.
218+
self.CurrentActivity?.Cancel(self);
219+
220+
self.QueueActivity(new Nudge(self));
221+
}
222+
210223
void INotifyKilled.Killed(Actor self, AttackInfo e)
211224
{
212225
if (Transport == null)

OpenRA.Mods.Common/Traits/Render/ProductionBar.cs

+6-1
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,12 @@ void ITick.Tick(Actor self)
7777
return;
7878

7979
var current = queue.AllQueued().Where(i => i.Started).MinByOrDefault(i => i.RemainingTime);
80-
value = current != null ? 1 - (float)current.RemainingCost / current.TotalCost : 0;
80+
if (current == null)
81+
value = 0;
82+
else if (current.TotalCost <= 0)
83+
value = 1;
84+
else
85+
value = 1 - (float)current.RemainingCost / current.TotalCost;
8186
}
8287

8388
float ISelectionBar.GetValue()

README.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ Check our [Playing the Game](https://github.com/OpenRA/OpenRA/wiki/Playing-the-g
4646
## Support
4747

4848
* Sponsor a [mirror server](https://github.com/OpenRA/OpenRAWebsiteV3/tree/master/packages) if you have some bandwidth to spare.
49-
* You can immediately set up a [Dedicated](https://github.com/OpenRA/OpenRA/wiki/Dedicated) Game Server.
49+
* You can immediately set up a [Dedicated](https://github.com/OpenRA/OpenRA/wiki/Dedicated-Server) Game Server.
5050

5151
## License
5252
Copyright (c) OpenRA Developers and Contributors

0 commit comments

Comments
 (0)