[Bug]: NormalizeVector returning a false vector length
Los mantenedores suelen responder en 1 día
Nadie ha tomado este issue todavía.
Evaluación
- Dificultad
- 3/5
- Tiempo estimado
- 1-2 días
- Aptitud para principiantes
- 35/100
Línea de trabajo
Start with core/smn_vector.cpp, particularly the VectorNormalize call at the linked location, and use the reproduction code to check how NormalizeVector handles a zero vector on the reported CSS version. Compare its returned length and vector with the previous-version results; done means zero input yields a zero length and zero vector without changing the expected behavior for other inputs.
Escrito por el modelo de indexación a partir del texto del issue.
Descripción
Prerequisites
- I have checked that my issue doesn't exist yet in the issue tracker
Operating System and Version
Debian GNU/Linux 12 (bookworm)
Game / AppID and Version
240 (Latest)
SourceMod Version
1.13.0.7215
Metamod:Source Version
1.12.0-dev+1217
Version Verification
- I have updated SourceMod to the latest version and the issue persists
- I have updated SourceMod to the latest snapshot and the issue persists
- I have updated Metamod:Source to the latest snapshot and the issue persists
Updated SourceMod Version
1.13.0.7219
Updated Metamod:Source Version
No response
Description
The NormalizeVector function doesn't work correctly with zero vectors in latest CSS versions (64 bit linux).
Instead of returning a zero length and a zero vector, it returns a very small, but incorrect, non-zero length.
This is different from how it behaves in the previous CSS version, where it correctly returns a zero length.
I guess a simple solution would be to implement an explicit check for zero vectors and returning a zero length instead of the VectorNormalize value.
Steps to Reproduce
#pragma semicolon 1
#pragma newdecls required
public void OnPluginStart()
{
RegAdminCmd("sm_test", Command_Test, ADMFLAG_ROOT, "Test command ( ͡° ͜ʖ ͡°)");
}
Action Command_Test(int client, int args)
{
float fAngles[3];
float fLength = NormalizeVector(fAngles, fAngles);
ReplyToCommand(client, "Length: %f", fLength);
return Plugin_Handled;
}
Relevant Log Output
Result (Latest CSS version)
sm_test
Length: 0.000009
Result (Previous CSS version)
sm_test
Length: 0.000000
- Lenguaje dominante
- C++
- Estrellas
- 1.2k
- Forks
- 476
- Merge medio
- 2 d 9 h
- PR fusionados (30 d)
- 13
Preparar el entorno
- Sin Dockerfile ni archivo de Docker Compose
- Sin plantilla de pull request
- Leer la guía de contribución
Primeros pasos
- Lee el issue completo y luego la guía de contribución del proyecto.
- Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
- Haz un fork del repositorio y trabaja en una rama.
- Abre un pull request que haga referencia al número del issue.
Más de alliedmodders/sourcemod
-
[Bug]: RoundToNearest truncates in plugins compiled with spcomp 1.13Posiblemente ocupada @fmu1337 la tomó hoy. AbiertoBug
Dificultad 2/5 1-3 horas Aptitud para principiantes 62/100
alliedmodders/sourcemod#2627 ·
Los mantenedores suelen responder en 1 día
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 78/100
alliedmodders/sourcemod#2615 ·
Los mantenedores suelen responder en 1 día
-
Bug
Dificultad 2/5 1-3 horas Aptitud para principiantes 72/100
alliedmodders/sourcemod#2613 · 1 comentario ·
Los mantenedores suelen responder en 1 día
-
Bug
Dificultad 2/5 1-3 horas Aptitud para principiantes 72/100
alliedmodders/sourcemod#2571 · 4 comentarios ·
Los mantenedores suelen responder en 1 día
-
Disable Nextmap for CSGO?AbiertoFeature Request
Dificultad 1/5 Menos de una hora Aptitud para principiantes 64/100
alliedmodders/sourcemod#2555 · 3 reacciones ·
Los mantenedores suelen responder en 1 día
Todos los issues de alliedmodders/sourcemod
Issues similares
-
[Bug] Windows Ghidra provider rejects a PATH-only JDK: bare `java.exe` probe fails with Win32 87Abierto
Dificultad 2/5 1-3 horas Aptitud para principiantes 72/100
Los mantenedores suelen responder en 1 día
-
type:bug
Dificultad 2/5 1-3 horas Aptitud para principiantes 72/100
Los mantenedores suelen responder en 1 día
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 72/100
tenstorrent/tt-umd#4084 ·
Los mantenedores suelen responder en 5 días
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 62/100
ToffelsKater/X4_VR#34 ·
-
difficulty:easy prio:low refactor
Dificultad 2/5 1-3 horas Aptitud para principiantes 72/100
NatronGitHub/openfx-supportext#220 ·
Los mantenedores suelen responder en 1 día