diff --git a/saco/game/util.cpp b/saco/game/util.cpp index bdf4ac2..103eb74 100644 --- a/saco/game/util.cpp +++ b/saco/game/util.cpp @@ -1467,6 +1467,18 @@ float DegToRad(float fDegrees) //---------------------------------------------------- +float InvDegToRad(float fDegrees) +{ + if (fDegrees > 360.0f || fDegrees < 0.0f) return 0.0f; + if (fDegrees > 180.0f) { + return (float)((-(PI - (((fDegrees - 180.0f) * PI) / 180.0f))) * -1.0f); + } else { + return (float)(((fDegrees * PI) / 180.0f) * -1.0f); + } +} + +//---------------------------------------------------- + bool IsNumeric(char * szString) { while(*szString) { diff --git a/saco/game/util.h b/saco/game/util.h index 00b3fd1..ba577bf 100644 --- a/saco/game/util.h +++ b/saco/game/util.h @@ -31,6 +31,8 @@ BYTE __stdcall FindPlayerNumFromPedPtr(DWORD dwPedPtr); void GameResetRadarColors(); float DegToRad(float fDegrees); +float InvDegToRad(float fDegrees); + void SaveCameraRaster(char *filename); BOOL IsFileOrDirectoryExists(char * szPath);