From e97c80d1386918d38221d55f856519cddadf2f01 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Johnny=20Bergstr=C3=B6m?= Date: Thu, 19 Feb 2004 11:24:58 +0000 Subject: [PATCH] fixed set_user_origin --- dlls/fun/fun.cpp | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) diff --git a/dlls/fun/fun.cpp b/dlls/fun/fun.cpp index 5c323e5d..ebd39738 100755 --- a/dlls/fun/fun.cpp +++ b/dlls/fun/fun.cpp @@ -397,16 +397,10 @@ static cell AMX_NATIVE_CALL set_user_origin(AMX *amx, cell *params) // set_user_ return 0; } - cell *newVectorCell = GET_AMXADDR(amx, params[3]); - - float newX = *(float *)((void *)&newVectorCell[0]); // JGHG: I cast a spell on you..... - float newY = *(float *)((void *)&newVectorCell[1]); - float newZ = *(float *)((void *)&newVectorCell[2]); - - Vector newVector = Vector(newX, newY, newZ); + cell *newVectorCell = GET_AMXADDR(amx, params[2]); SET_SIZE(pPlayer, pPlayer->v.mins, pPlayer->v.maxs); - SET_ORIGIN(pPlayer, newVector); + SET_ORIGIN(pPlayer, Vector((float)newVectorCell[0], (float)newVectorCell[1], (float)newVectorCell[2])); return 1; }