Skip to content

Conversation

@google-labs-jules
Copy link

This patch resolves server crashes when using bots in DeathMatch and Juggernaut modes.

The root cause was identified as bots entering invalid states:

  • In DM, bots were assigned TEAM_UNASSIGNED, putting them into an Observer-like limbo state that caused crashes in the behavior system.
  • In JGR, bots becoming Observers (e.g. after death without respawn) continued to run their update loops, accessing invalid memory.

The fix involves:

  • Forcing bots to valid teams (JINRAI/NSF) in DM mode.
  • Updating enemy detection logic so bots in DM still fight each other despite team assignment.
  • Making bots dormant (stopping updates) when they are in Observer mode.
  • Adding defensive checks in the main behavior update loop.

PR created automatically by Jules for task 14946624915128573691 started by @sunzenshen

This commit fixes crashes related to bots in DeathMatch and Juggernaut modes.

Fixes include:
1.  **DM Crash**: In `CNEOBotManager::MaintainBotQuota`, bots are now forced to join JINRAI/NSF teams even in DeathMatch. Previously, they were assigned `TEAM_UNASSIGNED`, which forced them into a limbo/Observer state that the bot logic could not handle, causing crashes.
2.  **DM Gameplay**: Updated `CNEOBot::IsEnemy` to ensure bots treat everyone as an enemy when `IsTeamplay()` is false (DM), compensating for the fact that they are now assigned to teams.
3.  **JGR/Observer Crash**: Updated `CNEOBot::IsDormantWhenDead` to return `true` if the bot is an observer. This prevents the NextBot update loop from running on spectator bots (e.g., after JGR death), avoiding memory violations.
4.  **Behavior Safety**: Added a `!IsAlive()` check in `CNEOBotMainAction::Update` to safely transition dead bots to the Dead behavior instead of executing the main update loop.
@google-labs-jules
Copy link
Author

👋 Jules, reporting for duty! I'm here to lend a hand with this pull request.

When you start a review, I'll add a 👀 emoji to each comment to let you know I've read it. I'll focus on feedback directed at me and will do my best to stay out of conversations between you and other bots or reviewers to keep the noise down.

I'll push a commit with your requested changes shortly after. Please note there might be a delay between these steps, but rest assured I'm on the job!

For more direct control, you can switch me to Reactive Mode. When this mode is on, I will only act on comments where you specifically mention me with @jules. You can find this option in the Pull Request section of your global Jules UI settings. You can always switch back!


For security, I will only act on instructions from the user who triggered this task.

New to Jules? Learn more at jules.google/docs.

@sunzenshen sunzenshen marked this pull request as ready for review December 15, 2025 06:52
@sunzenshen sunzenshen merged commit 5c80f36 into sandbox Dec 15, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants