Hacktoberfest 2026: los issues que los mantenedores marcaron para octubre, abiertos y aptos para principiantes. Explorar issues de Hacktoberfest

`MAX_` definitions (or lack thereof) break progressive initializer for arrays

Abierto
#47 0 comentarios 0 reacciones 0 asignados Ver en GitHub

Nadie ha tomado este issue todavía.

Evaluación

Dificultad
3/5
Tiempo estimado
1-2 días
Aptitud para principiantes
38/100
Tipo de issue
Error
Claridad
Bastante claro
Estado de actividad
Estancado
Área
tooling

Línea de trabajo

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.

Escrito por el modelo de indexación a partir del texto del issue.

Descripción

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.

Lenguaje dominante
Pawn
Estrellas
54
Forks
20
Métricas de merge de PR
Sin PR fusionados en 30 d

Guía de contribución

No hay ninguna guía de contribución indexada para este repositorio

Primeros pasos

  1. Lee el issue completo y luego la guía de contribución del proyecto.
  2. Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
  3. Haz un fork del repositorio y trabaja en una rama.
  4. Abre un pull request que haga referencia al número del issue.

Más de openmultiplayer/omp-stdlib

Todos los issues de openmultiplayer/omp-stdlib

Issues similares

Más issues de DevTools

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.