mirror of
https://github.com/openfrontio/OpenFrontIO.git
synced 2026-06-22 00:41:58 +00:00
Fix: don't stop seperation of MIRV warheads after launching player died (#3134)
## Description: Like Atom and H-bombs, MIRV warheads should still land after the launching player died. PlayerExecution already makes sure to skip nukes when deleting a dead player's units. But MIRVexecution separate() creates NukeExecutions which check canBuild, which returns false for a dead player. Fix: Skip alive and cost check for MIRV warheads. canBuild is only applicable when creating the MIRV itself, not at the seperation stage mid-flight. There's no cost involved either. Note: this bug has been there since MIRVs were added to the game. But the bug wasn't noticed often in all that time. Still the fix may have some impact on gameplay. ## Please complete the following: - [x] I have added screenshots for all UI updates - [x] I process any text displayed to the user through translateText() and I've added it to the en.json file - [x] I have added relevant tests to the test directory - [x] I confirm I have thoroughly tested these changes and take full responsibility for any bugs introduced ## Please put your Discord username so you can be contacted if a bug or regression is found: tryout33 Co-authored-by: Ryan <7389646+ryanbarlow97@users.noreply.github.com>
This commit is contained in:
@@ -988,7 +988,10 @@ export class PlayerImpl implements Player {
|
||||
}
|
||||
|
||||
const cost = this.mg.unitInfo(unitType).cost(this.mg, this);
|
||||
if (!this.isAlive() || this.gold() < cost) {
|
||||
if (
|
||||
unitType !== UnitType.MIRVWarhead &&
|
||||
(!this.isAlive() || this.gold() < cost)
|
||||
) {
|
||||
return false;
|
||||
}
|
||||
switch (unitType) {
|
||||
|
||||
Reference in New Issue
Block a user