You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
These are actually pointers to arrays of 4 vectors. The type used here - vec3_t - decays into a pointer and so when this code executes as intended it always assigns the first vector in each array to the baseline:
The function
CreateBaseline
takes 2 vectors as input:halflife/dlls/client.cpp
Lines 1284 to 1329 in c7240b9
These are actually pointers to arrays of 4 vectors. The type used here -
vec3_t
- decays into a pointer and so when this code executes as intended it always assigns the first vector in each array to the baseline:halflife/dlls/client.cpp
Lines 1301 to 1302 in c7240b9
But since
vec3_t
is aliased toVector
here:halflife/dlls/extdll.h
Lines 79 to 80 in c7240b9
The code instead treats the addresses passed as actual values. This results in the vectors assigned being invalid.
To fix this the function declaration and definition, and the interface need to be modified:
halflife/dlls/client.h
Line 47 in c7240b9
halflife/dlls/client.cpp
Line 1284 in c7240b9
halflife/engine/eiface.h
Line 481 in c7240b9
The vector parameters needs to be passed like this:
And the vectors need to be de-referenced to assign them:
The text was updated successfully, but these errors were encountered: