aboutsummaryrefslogtreecommitdiffstats
path: root/code/game/g_syscalls.c
diff options
context:
space:
mode:
Diffstat (limited to 'code/game/g_syscalls.c')
-rw-r--r--code/game/g_syscalls.c30
1 files changed, 15 insertions, 15 deletions
diff --git a/code/game/g_syscalls.c b/code/game/g_syscalls.c
index d82be06..59d89bd 100644
--- a/code/game/g_syscalls.c
+++ b/code/game/g_syscalls.c
@@ -36,9 +36,9 @@ void dllEntry( intptr_t (QDECL *syscallptr)( intptr_t arg,... ) ) {
}
int PASSFLOAT( float x ) {
- float floatTemp;
- floatTemp = x;
- return *(int *)&floatTemp;
+ floatint_t fi;
+ fi.f = x;
+ return fi.i;
}
void trap_Printf( const char *fmt ) {
@@ -290,9 +290,9 @@ void trap_AAS_PresenceTypeBoundingBox(int presencetype, vec3_t mins, vec3_t maxs
}
float trap_AAS_Time(void) {
- int temp;
- temp = syscall( BOTLIB_AAS_TIME );
- return (*(float*)&temp);
+ floatint_t fi;
+ fi.i = syscall( BOTLIB_AAS_TIME );
+ return fi.f;
}
int trap_AAS_PointAreaNum(vec3_t point) {
@@ -476,15 +476,15 @@ void trap_BotFreeCharacter(int character) {
}
float trap_Characteristic_Float(int character, int index) {
- int temp;
- temp = syscall( BOTLIB_AI_CHARACTERISTIC_FLOAT, character, index );
- return (*(float*)&temp);
+ floatint_t fi;
+ fi.i = syscall( BOTLIB_AI_CHARACTERISTIC_FLOAT, character, index );
+ return fi.f;
}
float trap_Characteristic_BFloat(int character, int index, float min, float max) {
- int temp;
- temp = syscall( BOTLIB_AI_CHARACTERISTIC_BFLOAT, character, index, PASSFLOAT(min), PASSFLOAT(max) );
- return (*(float*)&temp);
+ floatint_t fi;
+ fi.i = syscall( BOTLIB_AI_CHARACTERISTIC_BFLOAT, character, index, PASSFLOAT(min), PASSFLOAT(max) );
+ return fi.f;
}
int trap_Characteristic_Integer(int character, int index) {
@@ -652,9 +652,9 @@ int trap_BotGetMapLocationGoal(char *name, void /* struct bot_goal_s */ *goal) {
}
float trap_BotAvoidGoalTime(int goalstate, int number) {
- int temp;
- temp = syscall( BOTLIB_AI_AVOID_GOAL_TIME, goalstate, number );
- return (*(float*)&temp);
+ floatint_t fi;
+ fi.i = syscall( BOTLIB_AI_AVOID_GOAL_TIME, goalstate, number );
+ return fi.f;
}
void trap_BotSetAvoidGoalTime(int goalstate, int number, float avoidtime) {