`MAX_` definitions (or lack thereof) break progressive initializer for arrays
还没有人认领这个 Issue。
评估
- 难度
- 3/5
- 预计耗时
- 1-2 天
- 新手友好度
- 38/100
- Issue 类型
- 缺陷
- 描述清晰度
- 基本清楚
- 活跃度
- 停滞
- 领域
- tooling
调研方向
Locate the include definitions for MAX_WEAPONS and the related WEAPON_ constants, then reproduce the progressive initializer example from the issue. Check whether other tagged MAX_ definitions have the same shape and compare array sizing with the tag values. Done means the relevant MAX_ definitions consistently support initialization of every expected slot without breaking indexed access.
由索引模型根据 Issue 内容生成。
描述
Consider following snippet:
static bool:gIsWeaponAllowed[MAX_WEAPONS] = {true, ...};
public OnGameModeInit()
{
for (new i = 0; i < sizeof gIsWeaponAllowed; i++)
{
printf("%d: %d", i, gIsWeaponAllowed[WEAPON:i]);
}
return 1;
}
One would expect that all slots would be initialized to true, but only the first slot gets set.
[2024-07-27T18:24:52Z] [Info] 0: 1
[2024-07-27T18:24:52Z] [Info] 1: 0
[2024-07-27T18:24:52Z] [Info] 2: 0
...
[2024-07-27T18:24:52Z] [Info] 45: 0
[2024-07-27T18:24:52Z] [Info] 46: 0
Adding an additional
#define MAX_WEAPONS (WEAPON:47)
seems to remedy this problem and still allows the array to be indexed properly with the WEAPON_ definitions. This will probably need to be added for all tagged MAX_ definitions.
- 主要语言
- Pawn
- 星标
- 54
- 派生
- 20
- PR 合并指标
- 30 天内没有已合并 PR
贡献指南
这个仓库没有索引到贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
openmultiplayer/omp-stdlib 的其他 Issue
-
难度 4/5 3-5 天 新手友好度 35/100
openmultiplayer/omp-stdlib#50 · 1 条评论 · 3 个 reaction ·
-
难度 2/5 1-3 小时 新手友好度 45/100
查看 openmultiplayer/omp-stdlib 的全部 Issue
相似的 Issue
-
难度 2/5 1-3 小时 新手友好度 70/100
pastelsky/bundlephobia#1122 ·
-
难度 2/5 1-3 小时 新手友好度 75/100
anthropics/skills#1811 · 1 条评论 ·
-
bug
难度 2/5 1-3 小时 新手友好度 75/100
CachyOS/distribution#587 ·
-
bug
难度 2/5 1-3 小时 新手友好度 75/100
datalayer/mcp-compose#42 ·
-
难度 2/5 1-3 小时 新手友好度 70/100