Fixed ChatPrintf and CenterPrintf safety
This commit is contained in:
parent
9745464f7b
commit
7b27754858
2 changed files with 3 additions and 2 deletions
|
|
@ -173,6 +173,7 @@ typedef struct hudtextparms_s
|
|||
#define VEC_DUCK_VIEW Vector( 0, 0, 12 )
|
||||
|
||||
#define SVC_TEMPENTITY 23
|
||||
#define SVC_CENTERPRINT 26
|
||||
#define SVC_INTERMISSION 30
|
||||
#define SVC_CDTRACK 32
|
||||
#define SVC_WEAPONANIM 35
|
||||
|
|
|
|||
|
|
@ -81,6 +81,7 @@ void Engine::ChatPrintf (const char *fmt, ...)
|
|||
|
||||
MESSAGE_BEGIN (MSG_BROADCAST, FindMessageId (NETMSG_TEXTMSG));
|
||||
WRITE_BYTE (HUD_PRINTTALK);
|
||||
WRITE_STRING ("%s");
|
||||
WRITE_STRING (string);
|
||||
MESSAGE_END ();
|
||||
}
|
||||
|
|
@ -101,8 +102,7 @@ void Engine::CenterPrintf (const char *fmt, ...)
|
|||
}
|
||||
strcat (string, "\n");
|
||||
|
||||
MESSAGE_BEGIN (MSG_BROADCAST, FindMessageId (NETMSG_TEXTMSG));
|
||||
WRITE_BYTE (HUD_PRINTCENTER);
|
||||
MESSAGE_BEGIN (MSG_BROADCAST, SVC_CENTERPRINT);
|
||||
WRITE_STRING (string);
|
||||
MESSAGE_END ();
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue