`MAX_` definitions (or lack thereof) break progressive initializer for arrays
Nessuno ha ancora preso questa issue.
Valutazione
- Difficoltà
- 3/5
- Tempo stimato
- 1-2 giorni
- Idoneità per principianti
- 38/100
- Tipo di issue
- Bug
- Chiarezza
- Abbastanza chiara
- Stato di attività
- Ferma
- Ambito
- tooling
Direzione di ricerca
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.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
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.
- Lingua principale
- Pawn
- Stelle
- 54
- Fork
- 20
- Metriche di merge delle PR
- Nessuna PR unita negli ultimi 30g
Guida per i contributori
Nessuna guida per i contributori indicizzata per questo repository
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Altre issue di openmultiplayer/omp-stdlib
-
Difficoltà 4/5 3-5 giorni Idoneità per principianti 35/100
openmultiplayer/omp-stdlib#50 · 1 commento · 3 reazioni ·
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 45/100
Tutte le issue di openmultiplayer/omp-stdlib
Issue simili
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 75/100
palladius/rails8-app-on-gcp#145 ·
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 75/100
elastic/gradle-plugins#156 ·
-
area:workflow bug ready-for-agent
Difficoltà 2/5 1-3 ore Idoneità per principianti 75/100
fil-donadoni/tolaria#4409 ·
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 65/100
dotenvx/dotenv-vscode#139 ·
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 70/100
Fission-AI/OpenSpec#1960 ·