Hacktoberfest 2026:维护者为十月标记出来的 issue,仍然开放、适合新手。 浏览 Hacktoberfest issue

Some grenades have weird interactions...

未关闭
#116 0 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看

维护者通常 2 天内回复

还没有人认领这个 Issue。

评估

难度
4/5
预计耗时
3-5 天
新手友好度
35/100
Issue 类型
缺陷
描述清晰度
基本清楚
活跃度
停滞
技术栈
cpp
领域
game-dev

调研方向

Reproduce the impulse grenade behavior with the Dummy Faction using the five steps in the issue, then trace how AI weapon switching and grenade timers interact with inventory, equipping, dropping, and death. The issue does not name source files or tests, so begin at the grenade and AI weapon switching entry points. Done means grenades no longer detonate unexpectedly after being switched away from, equipped, dropped, or carried by a dying unit.

由索引模型根据 Issue 内容生成。

描述

bug

So I was playing with the Dummy Faction and found a weird bug with the impulse grenade.
If any unit controlled by the AI is left holding an impulse grenade in hand they will auto switch to their primary (if they have any) but the grenade will turn active on the units pocket, meaning that once you equip it or the unit dies (causing it to leave the inventory) it will trigger the explosion in pretty much an instant.

Here is how to do it:
Step 1: Have a fellow unit with the impulse grenade and any weapon.
Step 2: Take control of the unit and switch to the impulse grenade.
Step 3: Let the AI take control of the unit.
Step 4: Once again take control of the unit and switch to the impulse grenade.
Step 5: The impulse grenade will either explode as soon as you select it again or after a small delay, it will also activate on death or by dropping it.

Step 5 in particular happens with any other grenade if you first activate it in hand before switching to another weapon yourself (the AI won’t do it).

This grenade in inventory issue could be solved by either deactivating the grenade once a unit switch to another weapon (indirectly fixing the impulse grenade bug as well) or by keeping a timer on the unit that will eventually detonate the grenade on its pocket rather than once it gets dropped or equipped again (this would require fixing the impulse grenade being automatically activated by the AI like done above in Step 3).

The second fix sounds more funny and would fix the main issue of having a grenade with a 0-second timer in your inventory that explodes as soon as it appears.

主要语言
C++
星标
329
派生
47
平均合并
6 天 10 小时
30 天内合并 PR
14

环境准备

这个项目没有提供开发容器、Dockerfile 或贡献指南,环境需要你自己搭建:先看它的 README,通用步骤见我们的新手贡献指南。

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

cortex-command-community/Cortex-Command-Community-Project 的其他 Issue

查看 cortex-command-community/Cortex-Command-Community-Project 的全部 Issue

相似的 Issue

更多 C++ Issue

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。