diff --git a/rehlds/engine/common.cpp b/rehlds/engine/common.cpp index f65de7d..0573a4e 100644 --- a/rehlds/engine/common.cpp +++ b/rehlds/engine/common.cpp @@ -1702,7 +1702,11 @@ inquotes: /* <11495> ../engine/common.c:2049 */ char *COM_ParseLine(char *data) { +#ifndef REHLDS_FIXES + unsigned int c; +#else int c; +#endif int len; if (s_com_token_unget) @@ -1719,9 +1723,18 @@ char *COM_ParseLine(char *data) return NULL; } - c = *data; // TODO: data is signed, so will c, next check for >= ' ' will fail for upper ASCII + c = *data; // parse a line out of the data +#ifndef REHLDS_FIXES + while ((c >= ' ' || c == '\t') && (len < COM_TOKEN_LEN - 1)) + { + com_token[len] = c; + data++; + len++; + c = *data; + } +#else do { com_token[len] = c; // TODO: Here c may be any ASCII, \n for example, but we are copy it in the token @@ -1729,6 +1742,7 @@ char *COM_ParseLine(char *data) len++; c = *data; } while (c >= ' ' && (len < COM_TOKEN_LEN - 1)); // TODO: Will break on \t, may be it shouldn't? +#endif com_token[len] = 0; @@ -1738,7 +1752,7 @@ char *COM_ParseLine(char *data) } // eat whitespace (LF,CR,etc.) at the end of this line - while ((c = *data) < ' ') + while ((c = *data) < ' ' && c != '\t') { if (c == 0) { diff --git a/rehlds/public/rehlds/rehlds_api.h b/rehlds/public/rehlds/rehlds_api.h index ad7823b..70a1bdb 100644 --- a/rehlds/public/rehlds/rehlds_api.h +++ b/rehlds/public/rehlds/rehlds_api.h @@ -118,12 +118,12 @@ typedef IVoidHookChain IRehldsHook_Mod_LoadStudioModel; typedef IVoidHookChainRegistry IRehldsHookRegistry_Mod_LoadStudioModel; //SV_EmitEvents hook -typedef IVoidHookChain IRehldsHook_SV_EmitEvents; -typedef IVoidHookChainRegistry IRehldsHookRegistry_SV_EmitEvents; +typedef IVoidHookChain IRehldsHook_SV_EmitEvents; +typedef IVoidHookChainRegistry IRehldsHookRegistry_SV_EmitEvents; //EV_PlayReliableEvent hook -typedef IVoidHookChain IRehldsHook_EV_PlayReliableEvent; -typedef IVoidHookChainRegistry IRehldsHookRegistry_EV_PlayReliableEvent; +typedef IVoidHookChain IRehldsHook_EV_PlayReliableEvent; +typedef IVoidHookChainRegistry IRehldsHookRegistry_EV_PlayReliableEvent; //SV_StartSound hook typedef IVoidHookChain IRehldsHook_SV_StartSound; @@ -202,7 +202,7 @@ struct RehldsFuncs_t { cmd_source_t*(*GetCmdSource)(); void(*Log)(const char* prefix, const char* msg); DLL_FUNCTIONS *(*GetEntityInterface)(); - void(*EV_PlayReliableEvent)(IGameClient *cl, int entindex, short unsigned int eventindex, float delay, event_args_t *pargs); + void(*EV_PlayReliableEvent)(IGameClient *cl, int entindex, short unsigned int eventindex, float delay, struct event_args_s *pargs); int(*SV_LookupSoundIndex)(const char *sample); void(*MSG_StartBitWriting)(sizebuf_t *buf); void(*MSG_WriteBits)(uint32 data, int numbits);