mirror of
https://github.com/rehlds/rehlds.git
synced 2025-01-01 01:25:38 +03:00
Merge branch 'dreamstalker:master' into master
This commit is contained in:
commit
a92cf7a93e
16
.github/workflows/build.yml
vendored
16
.github/workflows/build.yml
vendored
@ -25,12 +25,12 @@ jobs:
|
|||||||
|
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout
|
- name: Checkout
|
||||||
uses: actions/checkout@v2
|
uses: actions/checkout@v3
|
||||||
with:
|
with:
|
||||||
fetch-depth: 0
|
fetch-depth: 0
|
||||||
|
|
||||||
- name: Setup MSBuild
|
- name: Setup MSBuild
|
||||||
uses: microsoft/setup-msbuild@v1.0.2
|
uses: microsoft/setup-msbuild@v1.1.3
|
||||||
|
|
||||||
- name: Build and Run unittests
|
- name: Build and Run unittests
|
||||||
run: |
|
run: |
|
||||||
@ -70,7 +70,7 @@ jobs:
|
|||||||
move msvc\${{ env.buildRelease }}\director.pdb publish\debug\director.pdb
|
move msvc\${{ env.buildRelease }}\director.pdb publish\debug\director.pdb
|
||||||
|
|
||||||
- name: Deploy artifacts
|
- name: Deploy artifacts
|
||||||
uses: actions/upload-artifact@v2
|
uses: actions/upload-artifact@v3.1.1
|
||||||
with:
|
with:
|
||||||
name: win32
|
name: win32
|
||||||
path: publish/*
|
path: publish/*
|
||||||
@ -92,7 +92,7 @@ jobs:
|
|||||||
|
|
||||||
steps:
|
steps:
|
||||||
- name: Deploying windows artifacts
|
- name: Deploying windows artifacts
|
||||||
uses: actions/download-artifact@v2
|
uses: actions/download-artifact@v3
|
||||||
with:
|
with:
|
||||||
name: win32
|
name: win32
|
||||||
|
|
||||||
@ -155,7 +155,7 @@ jobs:
|
|||||||
|
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout
|
- name: Checkout
|
||||||
uses: actions/checkout@v2
|
uses: actions/checkout@v3
|
||||||
with:
|
with:
|
||||||
fetch-depth: 0
|
fetch-depth: 0
|
||||||
|
|
||||||
@ -228,7 +228,7 @@ jobs:
|
|||||||
shell: bash
|
shell: bash
|
||||||
|
|
||||||
- name: Deploy artifacts
|
- name: Deploy artifacts
|
||||||
uses: actions/upload-artifact@v2
|
uses: actions/upload-artifact@v3.1.1
|
||||||
id: upload-job
|
id: upload-job
|
||||||
with:
|
with:
|
||||||
name: linux32
|
name: linux32
|
||||||
@ -247,12 +247,12 @@ jobs:
|
|||||||
|
|
||||||
steps:
|
steps:
|
||||||
- name: Deploying linux artifacts
|
- name: Deploying linux artifacts
|
||||||
uses: actions/download-artifact@v2
|
uses: actions/download-artifact@v3
|
||||||
with:
|
with:
|
||||||
name: linux32
|
name: linux32
|
||||||
|
|
||||||
- name: Deploying windows artifacts
|
- name: Deploying windows artifacts
|
||||||
uses: actions/download-artifact@v2
|
uses: actions/download-artifact@v3
|
||||||
with:
|
with:
|
||||||
name: win32
|
name: win32
|
||||||
|
|
||||||
|
@ -235,6 +235,7 @@ void Cbuf_Execute(void)
|
|||||||
}
|
}
|
||||||
|
|
||||||
// execute the command line
|
// execute the command line
|
||||||
|
if (line[0])
|
||||||
Cmd_ExecuteString(line, src_command);
|
Cmd_ExecuteString(line, src_command);
|
||||||
|
|
||||||
if (cmd_wait)
|
if (cmd_wait)
|
||||||
@ -406,16 +407,11 @@ void Cmd_Exec_f(void)
|
|||||||
else
|
else
|
||||||
{
|
{
|
||||||
char *pszDataPtr = configContents;
|
char *pszDataPtr = configContents;
|
||||||
while (true)
|
while (pszDataPtr && *pszDataPtr)
|
||||||
{
|
{
|
||||||
Cbuf_Execute(); // TODO: This doesn't obey the rule to first execute commands from the file, and then the others in the buffer
|
Cbuf_Execute(); // TODO: This doesn't obey the rule to first execute commands from the file, and then the others in the buffer
|
||||||
pszDataPtr = COM_ParseLine(pszDataPtr); // TODO: COM_ParseLine can be const char*
|
pszDataPtr = COM_ParseLine(pszDataPtr); // TODO: COM_ParseLine can be const char*
|
||||||
|
if (com_token[0])
|
||||||
if (com_token[0] == 0)
|
|
||||||
{
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
|
|
||||||
Cbuf_InsertTextLines(com_token);
|
Cbuf_InsertTextLines(com_token);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1197,7 +1197,11 @@ int Host_Init(quakeparms_t *parms)
|
|||||||
else
|
else
|
||||||
{
|
{
|
||||||
Cvar_RegisterVariable(&suitvolume);
|
Cvar_RegisterVariable(&suitvolume);
|
||||||
|
#ifdef REHLDS_FIXES
|
||||||
|
Cvar_RegisterVariable(&r_cachestudio);
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
Cbuf_InsertText("exec valve.rc\n");
|
Cbuf_InsertText("exec valve.rc\n");
|
||||||
Hunk_AllocName(0, "-HOST_HUNKLEVEL-");
|
Hunk_AllocName(0, "-HOST_HUNKLEVEL-");
|
||||||
host_hunklevel = Hunk_LowMark();
|
host_hunklevel = Hunk_LowMark();
|
||||||
|
@ -1802,7 +1802,14 @@ void EXT_FUNC PF_aim_I(edict_t *ent, float speed, float *rgflReturn)
|
|||||||
bestdir[1] = dir[1];
|
bestdir[1] = dir[1];
|
||||||
bestdir[2] = dir[2];
|
bestdir[2] = dir[2];
|
||||||
bestdir[0] = dir[0];
|
bestdir[0] = dir[0];
|
||||||
|
if (sv_allow_autoaim.value)
|
||||||
|
{
|
||||||
bestdist = sv_aim.value;
|
bestdist = sv_aim.value;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
bestdist = 0.0f;
|
||||||
|
}
|
||||||
|
|
||||||
for (int i = 1; i < g_psv.num_edicts; i++)
|
for (int i = 1; i < g_psv.num_edicts; i++)
|
||||||
{
|
{
|
||||||
|
@ -283,6 +283,7 @@ extern rehlds_server_t g_rehlds_sv;
|
|||||||
extern cvar_t sv_lan;
|
extern cvar_t sv_lan;
|
||||||
extern cvar_t sv_lan_rate;
|
extern cvar_t sv_lan_rate;
|
||||||
extern cvar_t sv_aim;
|
extern cvar_t sv_aim;
|
||||||
|
extern cvar_t sv_allow_autoaim;
|
||||||
|
|
||||||
extern cvar_t sv_skycolor_r;
|
extern cvar_t sv_skycolor_r;
|
||||||
extern cvar_t sv_skycolor_g;
|
extern cvar_t sv_skycolor_g;
|
||||||
|
@ -114,6 +114,7 @@ int giNextUserMsg = 64;
|
|||||||
cvar_t sv_lan = { "sv_lan", "0", 0, 0.0f, NULL };
|
cvar_t sv_lan = { "sv_lan", "0", 0, 0.0f, NULL };
|
||||||
cvar_t sv_lan_rate = { "sv_lan_rate", "20000.0", 0, 0.0f, NULL };
|
cvar_t sv_lan_rate = { "sv_lan_rate", "20000.0", 0, 0.0f, NULL };
|
||||||
cvar_t sv_aim = { "sv_aim", "1", FCVAR_SERVER | FCVAR_ARCHIVE , 0.0f, NULL };
|
cvar_t sv_aim = { "sv_aim", "1", FCVAR_SERVER | FCVAR_ARCHIVE , 0.0f, NULL };
|
||||||
|
cvar_t sv_allow_autoaim = { "sv_allow_autoaim", "1", FCVAR_SERVER | FCVAR_ARCHIVE, 0.0f, NULL };
|
||||||
|
|
||||||
cvar_t sv_skycolor_r = { "sv_skycolor_r", "0", 0, 0.0f, NULL };
|
cvar_t sv_skycolor_r = { "sv_skycolor_r", "0", 0, 0.0f, NULL };
|
||||||
cvar_t sv_skycolor_g = { "sv_skycolor_g", "0", 0, 0.0f, NULL };
|
cvar_t sv_skycolor_g = { "sv_skycolor_g", "0", 0, 0.0f, NULL };
|
||||||
@ -4697,13 +4698,27 @@ void SV_WriteEntitiesToClient(client_t *client, sizebuf_t *msg)
|
|||||||
auto &entityState = curPack->entities[i];
|
auto &entityState = curPack->entities[i];
|
||||||
if (entityState.number > MAX_CLIENTS)
|
if (entityState.number > MAX_CLIENTS)
|
||||||
{
|
{
|
||||||
if (sv_rehlds_attachedentities_playeranimationspeed_fix.string[0] == '1'
|
if (entityState.movetype == MOVETYPE_FOLLOW && entityState.aiment > 0)
|
||||||
&& entityState.movetype == MOVETYPE_FOLLOW
|
{
|
||||||
&& 1 <= entityState.aiment && entityState.aiment <= MAX_CLIENTS)
|
if (sv_rehlds_attachedentities_playeranimationspeed_fix.string[0] == '1' &&
|
||||||
|
entityState.aiment <= MAX_CLIENTS)
|
||||||
{
|
{
|
||||||
attachedEntCount[entityState.aiment]++;
|
attachedEntCount[entityState.aiment]++;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Prevent crash "Cache_UnlinkLRU: NULL link" on client-side
|
||||||
|
// if aiment with sprite model will be to render as a studio model
|
||||||
|
if (entityState.aiment < g_psv.num_edicts)
|
||||||
|
{
|
||||||
|
edict_t *ent = &g_psv.edicts[entityState.aiment];
|
||||||
|
if ((ent->v.modelindex >= 0 && ent->v.modelindex < MAX_MODELS)
|
||||||
|
&& g_psv.models[ent->v.modelindex]->type != mod_studio)
|
||||||
|
{
|
||||||
|
entityState.aiment = 0;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// Prevent spam "Non-sprite set to glow!" in console on client-side
|
// Prevent spam "Non-sprite set to glow!" in console on client-side
|
||||||
if (entityState.rendermode == kRenderGlow
|
if (entityState.rendermode == kRenderGlow
|
||||||
&& (entityState.modelindex >= 0 && entityState.modelindex < MAX_MODELS)
|
&& (entityState.modelindex >= 0 && entityState.modelindex < MAX_MODELS)
|
||||||
@ -8024,6 +8039,9 @@ void SV_Init(void)
|
|||||||
Cvar_RegisterVariable(&sv_visiblemaxplayers);
|
Cvar_RegisterVariable(&sv_visiblemaxplayers);
|
||||||
Cvar_RegisterVariable(&sv_password);
|
Cvar_RegisterVariable(&sv_password);
|
||||||
Cvar_RegisterVariable(&sv_aim);
|
Cvar_RegisterVariable(&sv_aim);
|
||||||
|
#ifdef REHLDS_FIXES
|
||||||
|
Cvar_RegisterVariable(&sv_allow_autoaim);
|
||||||
|
#endif
|
||||||
Cvar_RegisterVariable(&violence_hblood);
|
Cvar_RegisterVariable(&violence_hblood);
|
||||||
Cvar_RegisterVariable(&violence_ablood);
|
Cvar_RegisterVariable(&violence_ablood);
|
||||||
Cvar_RegisterVariable(&violence_hgibs);
|
Cvar_RegisterVariable(&violence_hgibs);
|
||||||
|
@ -1150,46 +1150,47 @@ void EXT_FUNC EngineFprintf(void *pfile, const char *szFmt, ...)
|
|||||||
|
|
||||||
void EXT_FUNC AlertMessage(ALERT_TYPE atype, const char *szFmt, ...)
|
void EXT_FUNC AlertMessage(ALERT_TYPE atype, const char *szFmt, ...)
|
||||||
{
|
{
|
||||||
|
char szOut[2048];
|
||||||
va_list argptr;
|
va_list argptr;
|
||||||
static char szOut[1024];
|
|
||||||
|
|
||||||
va_start(argptr, szFmt);
|
|
||||||
if (atype == at_logged && g_psvs.maxclients > 1)
|
if (atype == at_logged && g_psvs.maxclients > 1)
|
||||||
{
|
{
|
||||||
|
va_start(argptr, szFmt);
|
||||||
Q_vsnprintf(szOut, sizeof(szOut), szFmt, argptr);
|
Q_vsnprintf(szOut, sizeof(szOut), szFmt, argptr);
|
||||||
|
va_end(argptr);
|
||||||
|
|
||||||
Log_Printf("%s", szOut);
|
Log_Printf("%s", szOut);
|
||||||
|
return;
|
||||||
}
|
}
|
||||||
else if (developer.value != 0.0f)
|
|
||||||
{
|
if (!developer.value)
|
||||||
|
return;
|
||||||
|
|
||||||
|
if (atype == at_aiconsole && developer.value < 2)
|
||||||
|
return;
|
||||||
|
|
||||||
|
va_start(argptr, szFmt);
|
||||||
|
Q_vsnprintf(szOut, sizeof(szOut), szFmt, argptr);
|
||||||
|
va_end(argptr);
|
||||||
|
|
||||||
switch (atype)
|
switch (atype)
|
||||||
{
|
{
|
||||||
case at_notice:
|
case at_notice:
|
||||||
Q_strcpy(szOut, "NOTE: ");
|
Con_Printf("NOTE: %s", szOut);
|
||||||
break;
|
break;
|
||||||
case at_console:
|
case at_console:
|
||||||
szOut[0] = 0;
|
|
||||||
break;
|
|
||||||
case at_aiconsole:
|
case at_aiconsole:
|
||||||
if (developer.value < 2.0f)
|
Con_Printf("%s", szOut);
|
||||||
return;
|
|
||||||
szOut[0] = 0;
|
|
||||||
break;
|
break;
|
||||||
case at_warning:
|
case at_warning:
|
||||||
Q_strcpy(szOut, "WARNING: ");
|
Con_Printf("WARNING: %s", szOut);
|
||||||
break;
|
break;
|
||||||
case at_error:
|
case at_error:
|
||||||
Q_strcpy(szOut, "ERROR: ");
|
Con_Printf("ERROR: %s", szOut);
|
||||||
break;
|
|
||||||
case at_logged:
|
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
int iLen = Q_strlen(szOut);
|
|
||||||
Q_vsnprintf(&szOut[iLen], sizeof(szOut) - iLen, szFmt, argptr);
|
|
||||||
Con_Printf("%s", szOut);
|
|
||||||
}
|
|
||||||
va_end(argptr);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
NOXREF void Sys_SplitPath(const char *path, char *drive, char *dir, char *fname, char *ext)
|
NOXREF void Sys_SplitPath(const char *path, char *drive, char *dir, char *fname, char *ext)
|
||||||
|
Loading…
Reference in New Issue
Block a user