summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTony J. White <tjw@tjw.org>2006-12-04 21:37:26 +0000
committerTony J. White <tjw@tjw.org>2006-12-04 21:37:26 +0000
commit46aaba1136b501686d6c5b8be56f282bac71e980 (patch)
treea47bd0da9005e98c6661e13695c30988f0c7382c
parentd357d57d17bce82cf3017c323fd674efbf44d650 (diff)
* (bug 2934) stop inventing integer types tjw. no longer try to correct
a bad eventParm, but DO print a _useful_ warning.
-rw-r--r--src/game/g_utils.c14
1 files changed, 4 insertions, 10 deletions
diff --git a/src/game/g_utils.c b/src/game/g_utils.c
index f125f085..fb8a54dd 100644
--- a/src/game/g_utils.c
+++ b/src/game/g_utils.c
@@ -639,17 +639,11 @@ void G_AddEvent( gentity_t *ent, int event, int eventParm )
return;
}
- // eventParm is converted to int8_t in msg.c, so prevent rollover since
- // this would never be the intent of game code
- if( eventParm > 255 )
+ // eventParm is converted to uint8_t (0 - 255) in msg.c
+ if( eventParm & ~0xFF )
{
- eventParm = 255;
- G_Printf( S_COLOR_YELLOW "WARNING: G_AddEvent: eventParm overflow\n" );
- }
- else if( eventParm < -255 )
- {
- eventParm = -255;
- G_Printf( S_COLOR_YELLOW "WARNING: G_AddEvent: eventParm underrun\n" );
+ G_Printf( S_COLOR_YELLOW "WARNING: G_AddEvent: event %d "
+ " eventParm uint8_t overflow (given %d)\n", event, eventParm );
}
// clients need to add the event in playerState_t instead of entityState_t