mirror of
https://github.com/rehlds/rehlds.git
synced 2025-01-01 01:25:38 +03:00
Merge pull request #5 from WPMGPRoSToTeMa/master
Host say format and localize bug fix
This commit is contained in:
commit
459239b236
@ -2550,7 +2550,12 @@ void Host_Say(qboolean teamonly)
|
|||||||
p[Q_strlen(p) - 1] = 0;
|
p[Q_strlen(p) - 1] = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#ifdef REHLDS_FIXES
|
||||||
|
// I think '\x01' don't need in TextMsg
|
||||||
|
Q_snprintf(text, sizeof(text), "<%s> ", Cvar_VariableString("hostname"));
|
||||||
|
#else // REHLDS_FIXES
|
||||||
Q_snprintf(text, sizeof(text), "%c<%s> ", 1, Cvar_VariableString("hostname"));
|
Q_snprintf(text, sizeof(text), "%c<%s> ", 1, Cvar_VariableString("hostname"));
|
||||||
|
#endif // REHLDS_FIXES
|
||||||
|
|
||||||
if (Q_strlen(p) > 63)
|
if (Q_strlen(p) > 63)
|
||||||
p[63] = 0;
|
p[63] = 0;
|
||||||
@ -2569,10 +2574,19 @@ void Host_Say(qboolean teamonly)
|
|||||||
|
|
||||||
host_client = client;
|
host_client = client;
|
||||||
|
|
||||||
|
#ifdef REHLDS_FIXES
|
||||||
|
// Text can be unsafe (format %, localize #) therefore need to send text as argument. TextMsg is used here instead of SayText, because SayText in Half-Life doesn't support arguments.
|
||||||
|
PF_MessageBegin_I(MSG_ONE, RegUserMsg("TextMsg", -1), NULL, &g_psv.edicts[j + 1]);
|
||||||
|
PF_WriteByte_I(HUD_PRINTTALK);
|
||||||
|
PF_WriteString_I("%s");
|
||||||
|
PF_WriteString_I(text);
|
||||||
|
PF_MessageEnd_I();
|
||||||
|
#else // REHLDS_FIXES
|
||||||
PF_MessageBegin_I(MSG_ONE, RegUserMsg("SayText", -1), NULL, &g_psv.edicts[j + 1]);
|
PF_MessageBegin_I(MSG_ONE, RegUserMsg("SayText", -1), NULL, &g_psv.edicts[j + 1]);
|
||||||
PF_WriteByte_I(0);
|
PF_WriteByte_I(0);
|
||||||
PF_WriteString_I(text);
|
PF_WriteString_I(text);
|
||||||
PF_MessageEnd_I();
|
PF_MessageEnd_I();
|
||||||
|
#endif // REHLDS_FIXES
|
||||||
}
|
}
|
||||||
|
|
||||||
host_client = save;
|
host_client = save;
|
||||||
|
@ -49,3 +49,5 @@
|
|||||||
#include "rehlds_api_impl.h"
|
#include "rehlds_api_impl.h"
|
||||||
#include "FlightRecorderImpl.h"
|
#include "FlightRecorderImpl.h"
|
||||||
#include "flight_recorder.h"
|
#include "flight_recorder.h"
|
||||||
|
|
||||||
|
#include "dlls/cdll_dll.h"
|
||||||
|
Loading…
Reference in New Issue
Block a user