You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Fix MetaFight immediately failing if a defending brain is present.
In 3b301ef `MovableMan::AddActor()` was changed to do nothing if `g_ActivityMan.ActivityRunning()` returned false (and a couple other functions, but `AddActor()` is the one most relevant). `ActivityRunning()` returns false if an activity is either paused or in a state other than `Running` or `Editing`. MetaFight.lua sets up any pre-existing brains (for the defenders) while in the `PreGame` state. Since this isn't `Running` or `Editing`, the `AddActor()` call in `PlaceResidentBrain()` would do nothing, so the brain would never be added to `MovableMan.m_ValidActors`, so when MetaFight checked if the defending brain was still a valid actor, the check would fail, it would declare the defender's brain to be dead, and immediately kill every actor on the defending team. Since the invading brain didn't even have a chance to spawn, it would also see that the attacking team had no brains, and so you'd see the failure message. Since the point of the check was to avoid resolving a null pointer, I've replaced it with `g_ActivityMan.GetActivity()` instead.
While I was at it, `MetagameGUI::SetEnabled(true)` now calls `UpdatePlayerSetup()`, which means you can once again start a Conquest game immediately, without having to change any settings. I also changed MetaFight.lua so it no longer has hardcoded references to all four teams and instead uses `Activity.MAXTEAMCOUNT` and loops to ensure it should work regardless of how many teams there may be. I also fixed a typo in a local variable name and a small early return bug in `MetaFight:OrderHeavyLoadout()` which would prevent it from spawning more than one actor, and also prevent the guaranteed Light Digger from being added to the loadout.
Copy file name to clipboardExpand all lines: CHANGELOG.md
+10Lines changed: 10 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -4,6 +4,16 @@ All notable changes to this project will be documented in this file.
4
4
5
5
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
6
6
7
+
## [Unreleased]
8
+
9
+
<details><summary><b>Fixed</b></summary>
10
+
11
+
- Fixed regression introduced in 6.1 causing Conquest activities to immediately fail if a defending brain was present (and probably breaking other activities as well).
12
+
13
+
- Fixed the Conquest start game menu not letting you immediately start a game until you tweak some settings.
0 commit comments