Fix endline in files, without code changes

Run: sed -i 's/[[:blank:]]*$//' */*.{c,h}
This commit is contained in:
Denis Pauk 2023-10-29 01:57:03 +03:00
parent e1fd35316d
commit 64215c04f6
22 changed files with 102 additions and 102 deletions

View file

@ -576,7 +576,7 @@ Sys_RemoveDir(const char *path)
WCHAR wpathwithwildcard[MAX_OSPATH] = {0}; WCHAR wpathwithwildcard[MAX_OSPATH] = {0};
WCHAR wpathwithfilename[MAX_OSPATH] = {0}; WCHAR wpathwithfilename[MAX_OSPATH] = {0};
WIN32_FIND_DATAW fd; WIN32_FIND_DATAW fd;
if (MultiByteToWideChar(CP_UTF8, 0, path, -1, wpath, MAX_OSPATH) >= MAX_QPATH) if (MultiByteToWideChar(CP_UTF8, 0, path, -1, wpath, MAX_OSPATH) >= MAX_QPATH)
{ {
/* This is hopefully never reached, because in a good /* This is hopefully never reached, because in a good
@ -588,7 +588,7 @@ Sys_RemoveDir(const char *path)
wcsncpy(wpathwithwildcard, wpath, MAX_OSPATH); wcsncpy(wpathwithwildcard, wpath, MAX_OSPATH);
wcscat(wpathwithwildcard, L"\\*.*"); wcscat(wpathwithwildcard, L"\\*.*");
HANDLE hFind = FindFirstFileW(wpathwithwildcard, &fd); HANDLE hFind = FindFirstFileW(wpathwithwildcard, &fd);
if (hFind != INVALID_HANDLE_VALUE) if (hFind != INVALID_HANDLE_VALUE)
{ {
@ -603,13 +603,13 @@ Sys_RemoveDir(const char *path)
wmemset(wpathwithfilename, 0, MAX_OSPATH); wmemset(wpathwithfilename, 0, MAX_OSPATH);
wcscat(wpathwithfilename, wpath); wcscat(wpathwithfilename, wpath);
wcscat(wpathwithfilename, fd.cFileName); wcscat(wpathwithfilename, fd.cFileName);
DeleteFileW(wpathwithfilename); DeleteFileW(wpathwithfilename);
} }
while (FindNextFileW(hFind, &fd)); while (FindNextFileW(hFind, &fd));
FindClose(hFind); FindClose(hFind);
} }
RemoveDirectoryW(wpath); RemoveDirectoryW(wpath);
} }

View file

@ -558,7 +558,7 @@ CL_AddMuzzleFlash2(void)
CL_SmokeAndFlash(origin); CL_SmokeAndFlash(origin);
Com_sprintf(soundname, sizeof(soundname), "tank/tnkatk2%c.wav", Com_sprintf(soundname, sizeof(soundname), "tank/tnkatk2%c.wav",
'a' + (char)(randk() % 5)); 'a' + (char)(randk() % 5));
S_StartSound(NULL, ent, CHAN_WEAPON, S_StartSound(NULL, ent, CHAN_WEAPON,
S_RegisterSound(soundname), 1, ATTN_NORM, 0); S_RegisterSound(soundname), 1, ATTN_NORM, 0);
break; break;
@ -1316,7 +1316,7 @@ MakeNormalVectors(vec3_t forward, vec3_t right, vec3_t up)
{ {
float d; float d;
/* this rotate and negate guarantees a /* this rotate and negate guarantees a
vector not colinear with the original */ vector not colinear with the original */
right[1] = -forward[0]; right[1] = -forward[0];
right[2] = forward[1]; right[2] = forward[1];
@ -1981,7 +1981,7 @@ CL_TeleportParticles(vec3_t org)
} }
/* /*
* An entity has just been parsed that has an * An entity has just been parsed that has an
* event value. the female events are there for * event value. the female events are there for
* backwards compatability * backwards compatability
*/ */

View file

@ -145,7 +145,7 @@ qboolean qcurlInit(void)
var = Sys_GetProcAddress(curlhandle, sym); \ var = Sys_GetProcAddress(curlhandle, sym); \
if (!var) goto error; \ if (!var) goto error; \
} while(0) } while(0)
CONCURL(qcurl_easy_cleanup, "curl_easy_cleanup"); CONCURL(qcurl_easy_cleanup, "curl_easy_cleanup");
CONCURL(qcurl_easy_init, "curl_easy_init"); CONCURL(qcurl_easy_init, "curl_easy_init");
CONCURL(qcurl_easy_getinfo, "curl_easy_getinfo"); CONCURL(qcurl_easy_getinfo, "curl_easy_getinfo");

View file

@ -87,7 +87,7 @@ typedef struct
typedef struct typedef struct
{ {
menucommon_s generic; menucommon_s generic;
char * focuspic; char * focuspic;
char * errorpic; char * errorpic;
int width; int width;
int height; int height;

View file

@ -2447,7 +2447,7 @@ Options_MenuInit(void)
s_options_crosshair_box.generic.name = "crosshair"; s_options_crosshair_box.generic.name = "crosshair";
s_options_crosshair_box.generic.callback = CrosshairFunc; s_options_crosshair_box.generic.callback = CrosshairFunc;
s_options_crosshair_box.itemnames = crosshair_names; s_options_crosshair_box.itemnames = crosshair_names;
s_options_pauseonfocus_box.generic.type = MTYPE_SPINCONTROL; s_options_pauseonfocus_box.generic.type = MTYPE_SPINCONTROL;
s_options_pauseonfocus_box.generic.x = 0; s_options_pauseonfocus_box.generic.x = 0;
s_options_pauseonfocus_box.generic.y = (y += 10); s_options_pauseonfocus_box.generic.y = (y += 10);
@ -5515,11 +5515,11 @@ PlayerDirectoryList(void)
char* t = list[i]; char* t = list[i];
YQ2_COM_CHECK_OOM(s, "malloc()", MAX_QPATH * sizeof(char)) YQ2_COM_CHECK_OOM(s, "malloc()", MAX_QPATH * sizeof(char))
Q_strlcpy(s, t, MAX_QPATH); Q_strlcpy(s, t, MAX_QPATH);
data[i] = s; data[i] = s;
} }
// free file list // free file list
FS_FreeList(list, num); FS_FreeList(list, num);
@ -5570,7 +5570,7 @@ PlayerModelList(void)
// contains triangle .md2 model // contains triangle .md2 model
s = s_directory.data[i]; s = s_directory.data[i];
if (ContainsFile(s, "tris.md2") == false) if (ContainsFile(s, "tris.md2") == false)
{ {
continue; // invalid player model continue; // invalid player model
@ -5607,7 +5607,7 @@ PlayerModelList(void)
data = (char**)malloc((s_skinnames[mdl].num + 1) * sizeof(char*)); data = (char**)malloc((s_skinnames[mdl].num + 1) * sizeof(char*));
YQ2_COM_CHECK_OOM(data, "malloc()", (s_skinnames[mdl].num + 1) * sizeof(char*)) YQ2_COM_CHECK_OOM(data, "malloc()", (s_skinnames[mdl].num + 1) * sizeof(char*))
memset(data, 0, (s_skinnames[mdl].num + 1) * sizeof(char*)); memset(data, 0, (s_skinnames[mdl].num + 1) * sizeof(char*));
s_skinnames[mdl].data = data; s_skinnames[mdl].data = data;
s_skinnames[mdl].num = 0; s_skinnames[mdl].num = 0;

View file

@ -266,7 +266,7 @@ static const char* fragmentSrc2DpostprocessWater = MULTILINE_STRING(
uniform sampler2D tex; uniform sampler2D tex;
uniform float time; uniform float time;
uniform vec4 v_blend; uniform vec4 v_blend;
out vec4 outColor; out vec4 outColor;
@ -286,7 +286,7 @@ static const char* fragmentSrc2DpostprocessWater = MULTILINE_STRING(
uv = clamp(uv, vec2(0.0, 0.0), vec2(1.0, 1.0)); uv = clamp(uv, vec2(0.0, 0.0), vec2(1.0, 1.0));
vec4 res = texture(tex, uv); vec4 res = texture(tex, uv);
// apply the v_blend, usually blended as a colored quad with: // apply the v_blend, usually blended as a colored quad with:
res.rgb = v_blend.a * v_blend.rgb + (1.0 - v_blend.a) * res.rgb; res.rgb = v_blend.a * v_blend.rgb + (1.0 - v_blend.a) * res.rgb;
outColor = res; outColor = res;
@ -1331,11 +1331,11 @@ updateUBO(GLuint ubo, GLsizeiptr size, void* data)
we don't need to use glBindBufferRange and we can leave that alone for now. we don't need to use glBindBufferRange and we can leave that alone for now.
*/ */
glBufferData(GL_UNIFORM_BUFFER, size, NULL, GL_STREAM_DRAW); // atsb: GL_STREAM_DRAW glBufferData(GL_UNIFORM_BUFFER, size, NULL, GL_STREAM_DRAW); // atsb: GL_STREAM_DRAW
/* /*
atsb: we use GL_MAP_WRITE_BIT here to ensure synchronisation between CPU/GPU atsb: we use GL_MAP_WRITE_BIT here to ensure synchronisation between CPU/GPU
and to prevent any possible data races in cases of sync loss. and to prevent any possible data races in cases of sync loss.
we don't use the persistent mapping feature yet as that would require we don't use the persistent mapping feature yet as that would require
a bit more work with how the buffers are created and mapped. a bit more work with how the buffers are created and mapped.
*/ */

View file

@ -72,7 +72,7 @@ float pm_waterspeed = 400;
#define STOP_EPSILON 0.1 /* Slide off of the impacting object returns the blocked flags (1 = floor, 2 = step / wall) */ #define STOP_EPSILON 0.1 /* Slide off of the impacting object returns the blocked flags (1 = floor, 2 = step / wall) */
#define MIN_STEP_NORMAL 0.7 /* can't step up onto very steep slopes */ #define MIN_STEP_NORMAL 0.7 /* can't step up onto very steep slopes */
#define MAX_CLIP_PLANES 5 #define MAX_CLIP_PLANES 5
void void
PM_ClipVelocity(vec3_t in, vec3_t normal, vec3_t out, float overbounce) PM_ClipVelocity(vec3_t in, vec3_t normal, vec3_t out, float overbounce)
@ -548,7 +548,7 @@ PM_WaterMove(void)
/* user intentions */ /* user intentions */
for (i = 0; i < 3; i++) for (i = 0; i < 3; i++)
{ {
wishvel[i] = pml.forward[i] * pm->cmd.forwardmove + wishvel[i] = pml.forward[i] * pm->cmd.forwardmove +
pml.right[i] * pm->cmd.sidemove; pml.right[i] * pm->cmd.sidemove;
} }

View file

@ -22,7 +22,7 @@
* Chase cam. * Chase cam.
* *
* ======================================================================= * =======================================================================
*/ */
#include "header/local.h" #include "header/local.h"

View file

@ -43,19 +43,19 @@ Svcmd_Test_f(void)
* addip <ip> * addip <ip>
* removeip <ip> * removeip <ip>
* *
* The ip address is specified in dot format, and any unspecified * The ip address is specified in dot format, and any unspecified
* digits will match any value, so you can specify an entire class C * digits will match any value, so you can specify an entire class C
* network with "addip 192.246.40". * network with "addip 192.246.40".
* *
* Removeip will only remove an address specified exactly the same way. * Removeip will only remove an address specified exactly the same way.
* You cannot addip a subnet, then removeip a single host. * You cannot addip a subnet, then removeip a single host.
* *
* listip * listip
* Prints the current list of filters. * Prints the current list of filters.
* *
* writeip * writeip
* Dumps "addip <ip>" commands to listip.cfg so it can be execed at a * Dumps "addip <ip>" commands to listip.cfg so it can be execed at a
* later date. The filter lists are not saved and restored by default, * later date. The filter lists are not saved and restored by default,
* because I beleive it would cause too much confusion. * because I beleive it would cause too much confusion.
* *
* filterban <0 or 1> * filterban <0 or 1>
@ -64,7 +64,7 @@ Svcmd_Test_f(void)
* be prohibited from entering the game. This is the default setting. * be prohibited from entering the game. This is the default setting.
* *
* If 0, then only addresses matching the list will be allowed. This lets * If 0, then only addresses matching the list will be allowed. This lets
* you easily set up a private game, or a game that only allows players * you easily set up a private game, or a game that only allows players
* from your local network. * from your local network.
* *
* *

View file

@ -22,7 +22,7 @@
* Targets. * Targets.
* *
* ======================================================================= * =======================================================================
*/ */
#include "header/local.h" #include "header/local.h"
@ -57,10 +57,10 @@ SP_target_temp_entity(edict_t *ent)
* 1 = normal fighting sounds * 1 = normal fighting sounds
* 2 = idle sound level * 2 = idle sound level
* 3 = ambient sound level * 3 = ambient sound level
* *
* "volume" 0.0 to 1.0 * "volume" 0.0 to 1.0
* *
* Normal sounds play each time the target is used. The reliable flag * Normal sounds play each time the target is used. The reliable flag
* can be set for crucial voiceovers. * can be set for crucial voiceovers.
* *
* Looped sounds are allways atten 3 / vol 1, and the use function toggles * Looped sounds are allways atten 3 / vol 1, and the use function toggles
@ -73,7 +73,7 @@ Use_Target_Speaker(edict_t *ent, edict_t *other, edict_t *activator)
int chan; int chan;
if (ent->spawnflags & 3) if (ent->spawnflags & 3)
{ {
/* looping sound toggles */ /* looping sound toggles */
if (ent->s.sound) if (ent->s.sound)
{ {
@ -148,7 +148,7 @@ SP_target_speaker(edict_t *ent)
ent->use = Use_Target_Speaker; ent->use = Use_Target_Speaker;
/* must link the entity so we get areas and clusters so /* must link the entity so we get areas and clusters so
the server can determine who to send updates to */ the server can determine who to send updates to */
gi.linkentity(ent); gi.linkentity(ent);
} }
@ -172,14 +172,14 @@ Use_Target_Help(edict_t *ent, edict_t *other, edict_t *activator)
/* /*
* QUAKED target_help (1 0 1) (-16 -16 -24) (16 16 24) help1 * QUAKED target_help (1 0 1) (-16 -16 -24) (16 16 24) help1
* When fired, the "message" key becomes the current personal computer * When fired, the "message" key becomes the current personal computer
* string, and the message light will be set on all clients status bars. * string, and the message light will be set on all clients status bars.
*/ */
void void
SP_target_help(edict_t *ent) SP_target_help(edict_t *ent)
{ {
if (deathmatch->value) if (deathmatch->value)
{ {
/* auto-remove for deathmatch */ /* auto-remove for deathmatch */
G_FreeEdict(ent); G_FreeEdict(ent);
return; return;
@ -218,7 +218,7 @@ void
SP_target_secret(edict_t *ent) SP_target_secret(edict_t *ent)
{ {
if (deathmatch->value) if (deathmatch->value)
{ {
/* auto-remove for deathmatch */ /* auto-remove for deathmatch */
G_FreeEdict(ent); G_FreeEdict(ent);
return; return;
@ -271,7 +271,7 @@ void
SP_target_goal(edict_t *ent) SP_target_goal(edict_t *ent)
{ {
if (deathmatch->value) if (deathmatch->value)
{ {
/* auto-remove for deathmatch */ /* auto-remove for deathmatch */
G_FreeEdict(ent); G_FreeEdict(ent);
return; return;
@ -552,9 +552,9 @@ SP_target_blaster(edict_t *self)
/* /*
* QUAKED target_crosslevel_trigger (.5 .5 .5) (-8 -8 -8) (8 8 8) trigger1 trigger2 trigger3 trigger4 trigger5 trigger6 trigger7 trigger8 * QUAKED target_crosslevel_trigger (.5 .5 .5) (-8 -8 -8) (8 8 8) trigger1 trigger2 trigger3 trigger4 trigger5 trigger6 trigger7 trigger8
* *
* Once this trigger is touched/used, any trigger_crosslevel_target with the * Once this trigger is touched/used, any trigger_crosslevel_target with the
* same trigger number is automatically used when a level is started within * same trigger number is automatically used when a level is started within
* the same unit. It is OK to check multiple triggers. Message, delay, target, * the same unit. It is OK to check multiple triggers. Message, delay, target,
* and killtarget also work. * and killtarget also work.
*/ */

View file

@ -40,9 +40,9 @@ InitTrigger(edict_t *self)
self->svflags = SVF_NOCLIENT; self->svflags = SVF_NOCLIENT;
} }
/* /*
* The wait time has passed, so set * The wait time has passed, so set
* back up for another activation * back up for another activation
*/ */
void void
multi_wait(edict_t *ent) multi_wait(edict_t *ent)
@ -125,13 +125,13 @@ Touch_Multi(edict_t *self, edict_t *other, cplane_t *plane, csurface_t *surf)
* Variable sized repeatable trigger. Must be targeted at one or more entities. * Variable sized repeatable trigger. Must be targeted at one or more entities.
* If "delay" is set, the trigger waits some time after activating before firing. * If "delay" is set, the trigger waits some time after activating before firing.
* "wait" : Seconds between triggerings. (.2 default) * "wait" : Seconds between triggerings. (.2 default)
* *
* sounds * sounds
* 1) secret * 1) secret
* 2) beep beep * 2) beep beep
* 3) large switch * 3) large switch
* 4) * 4)
* *
* set "message" to text string * set "message" to text string
*/ */
void void
@ -190,7 +190,7 @@ SP_trigger_multiple(edict_t *ent)
/* /*
* QUAKED trigger_once (.5 .5 .5) ? x x TRIGGERED * QUAKED trigger_once (.5 .5 .5) ? x x TRIGGERED
* Triggers once, then removes itself. * Triggers once, then removes itself.
* You must set the key "target" to the name of another object * You must set the key "target" to the name of another object
* in the level that has a matching "targetname". * in the level that has a matching "targetname".
* *
* If TRIGGERED, this trigger must be triggered before it is live. * If TRIGGERED, this trigger must be triggered before it is live.
@ -207,7 +207,7 @@ SP_trigger_multiple(edict_t *ent)
void void
SP_trigger_once(edict_t *ent) SP_trigger_once(edict_t *ent)
{ {
/* make old maps work because I messed up on flag assignments here /* make old maps work because I messed up on flag assignments here
triggered was on bit 1 when it should have been on bit 4 */ triggered was on bit 1 when it should have been on bit 4 */
if (ent->spawnflags & 1) if (ent->spawnflags & 1)
{ {
@ -395,10 +395,10 @@ SP_trigger_key(edict_t *self)
* QUAKED trigger_counter (.5 .5 .5) ? nomessage * QUAKED trigger_counter (.5 .5 .5) ? nomessage
* Acts as an intermediary for an action that takes multiple inputs. * Acts as an intermediary for an action that takes multiple inputs.
* *
* If nomessage is not set, t will print "1 more.. " etc when triggered * If nomessage is not set, t will print "1 more.. " etc when triggered
* and "sequence complete" when finished. * and "sequence complete" when finished.
* *
* After the counter has been triggered "count" times (default 2), it * After the counter has been triggered "count" times (default 2), it
* will fire all of it's targets and remove itself. * will fire all of it's targets and remove itself.
*/ */
void void

View file

@ -189,8 +189,8 @@ Think_Delay(edict_t *ent)
* The global "activator" should be set to the entity * The global "activator" should be set to the entity
* that initiated the firing. * that initiated the firing.
* *
* If self.delay is set, a DelayedUse entity will be * If self.delay is set, a DelayedUse entity will be
* created that will actually do the SUB_UseTargets * created that will actually do the SUB_UseTargets
* after that many seconds have passed. * after that many seconds have passed.
* *
* Centerprints any self.message to the activator. * Centerprints any self.message to the activator.
@ -563,7 +563,7 @@ G_Spawn(void)
for (i = maxclients->value + 1; i < globals.num_edicts; i++, e++) for (i = maxclients->value + 1; i < globals.num_edicts; i++, e++)
{ {
/* the first couple seconds of server time can involve a lot of /* the first couple seconds of server time can involve a lot of
freeing and allocating, so relax the replacement policy */ freeing and allocating, so relax the replacement policy */
if (!e->inuse && ((e->freetime < 2) || (level.time - e->freetime > 0.5))) if (!e->inuse && ((e->freetime < 2) || (level.time - e->freetime > 0.5)))
{ {
@ -616,7 +616,7 @@ G_TouchTriggers(edict_t *ent)
num = gi.BoxEdicts(ent->absmin, ent->absmax, touch, num = gi.BoxEdicts(ent->absmin, ent->absmax, touch,
MAX_EDICTS, AREA_TRIGGERS); MAX_EDICTS, AREA_TRIGGERS);
/* be careful, it is possible to have an entity in this /* be careful, it is possible to have an entity in this
list removed before we get to it (killtriggered) */ list removed before we get to it (killtriggered) */
for (i = 0; i < num; i++) for (i = 0; i < num; i++)
{ {
@ -649,7 +649,7 @@ G_TouchSolids(edict_t *ent)
num = gi.BoxEdicts(ent->absmin, ent->absmax, touch, num = gi.BoxEdicts(ent->absmin, ent->absmax, touch,
MAX_EDICTS, AREA_SOLID); MAX_EDICTS, AREA_SOLID);
/* be careful, it is possible to have an entity in this /* be careful, it is possible to have an entity in this
list removed before we get to it (killtriggered) */ list removed before we get to it (killtriggered) */
for (i = 0; i < num; i++) for (i = 0; i < num; i++)
{ {

View file

@ -22,7 +22,7 @@
* The player trail, used by monsters to locate the player. * The player trail, used by monsters to locate the player.
* *
* ======================================================================= * =======================================================================
*/ */
#include "../header/local.h" #include "../header/local.h"

View file

@ -800,14 +800,14 @@ P_WorldEffects(void)
if ((old_waterlevel == 3) && (waterlevel != 3)) if ((old_waterlevel == 3) && (waterlevel != 3))
{ {
if (current_player->air_finished < level.time) if (current_player->air_finished < level.time)
{ {
/* gasp for air */ /* gasp for air */
gi.sound(current_player, CHAN_VOICE, gi.sound(current_player, CHAN_VOICE,
gi.soundindex("player/gasp1.wav"), 1, ATTN_NORM, 0); gi.soundindex("player/gasp1.wav"), 1, ATTN_NORM, 0);
PlayerNoise(current_player, current_player->s.origin, PNOISE_SELF); PlayerNoise(current_player, current_player->s.origin, PNOISE_SELF);
} }
else if (current_player->air_finished < level.time + 11) else if (current_player->air_finished < level.time + 11)
{ {
/* just break surface */ /* just break surface */
gi.sound(current_player, CHAN_VOICE, gi.sound(current_player, CHAN_VOICE,
gi.soundindex("player/gasp2.wav"), 1, ATTN_NORM, 0); gi.soundindex("player/gasp2.wav"), 1, ATTN_NORM, 0);
@ -844,7 +844,7 @@ P_WorldEffects(void)
/* if out of air, start drowning */ /* if out of air, start drowning */
if (current_player->air_finished < level.time) if (current_player->air_finished < level.time)
{ {
/* drown! */ /* drown! */
if ((current_player->client->next_drown_time < level.time) && if ((current_player->client->next_drown_time < level.time) &&
(current_player->health > 0)) (current_player->health > 0))
@ -931,7 +931,7 @@ P_WorldEffects(void)
if (current_player->watertype & CONTENTS_SLIME) if (current_player->watertype & CONTENTS_SLIME)
{ {
if (!envirosuit) if (!envirosuit)
{ {
/* no damage from slime with envirosuit */ /* no damage from slime with envirosuit */
T_Damage(current_player, world, world, vec3_origin, T_Damage(current_player, world, world, vec3_origin,
current_player->s.origin, vec3_origin, current_player->s.origin, vec3_origin,
@ -1124,7 +1124,7 @@ G_SetClientFrame(edict_t *ent)
} }
} }
else if (ent->s.frame < client->anim_end) else if (ent->s.frame < client->anim_end)
{ {
/* continue an animation */ /* continue an animation */
ent->s.frame++; ent->s.frame++;
return; return;
@ -1149,7 +1149,7 @@ G_SetClientFrame(edict_t *ent)
} }
newanim: newanim:
/* return to either a running or standing frame */ /* return to either a running or standing frame */
client->anim_priority = ANIM_BASIC; client->anim_priority = ANIM_BASIC;
client->anim_duck = duck; client->anim_duck = duck;
@ -1177,7 +1177,7 @@ newanim:
} }
} }
else if (run) else if (run)
{ {
/* running */ /* running */
if (duck) if (duck)
{ {
@ -1221,7 +1221,7 @@ ClientEndServerFrame(edict_t *ent)
/* If the origin or velocity have changed since ClientThink(), /* If the origin or velocity have changed since ClientThink(),
update the pmove values. This will happen when the client update the pmove values. This will happen when the client
is pushed by a bmodel or kicked by an explosion. is pushed by a bmodel or kicked by an explosion.
If it wasn't updated here, the view position would lag a frame If it wasn't updated here, the view position would lag a frame
behind the body position when pushed -- "sinking into plats" */ behind the body position when pushed -- "sinking into plats" */
@ -1261,7 +1261,7 @@ ClientEndServerFrame(edict_t *ent)
ent->s.angles[ROLL] = 0; ent->s.angles[ROLL] = 0;
ent->s.angles[ROLL] = SV_CalcRoll(ent->s.angles, ent->velocity) * 4; ent->s.angles[ROLL] = SV_CalcRoll(ent->s.angles, ent->velocity) * 4;
/* calculate speed and cycle to be used for /* calculate speed and cycle to be used for
all cyclic walking effects */ all cyclic walking effects */
xyspeed = sqrt(ent->velocity[0] * ent->velocity[0] + ent->velocity[1] * xyspeed = sqrt(ent->velocity[0] * ent->velocity[0] + ent->velocity[1] *
ent->velocity[1]); ent->velocity[1]);
@ -1272,7 +1272,7 @@ ClientEndServerFrame(edict_t *ent)
current_client->bobtime = 0; /* start at beginning of cycle again */ current_client->bobtime = 0; /* start at beginning of cycle again */
} }
else if (ent->groundentity) else if (ent->groundentity)
{ {
/* so bobbing only cycles when on ground */ /* so bobbing only cycles when on ground */
if (xyspeed > 210) if (xyspeed > 210)
{ {
@ -1310,7 +1310,7 @@ ClientEndServerFrame(edict_t *ent)
/* determine the gun offsets */ /* determine the gun offsets */
SV_CalcGunOffset(ent); SV_CalcGunOffset(ent);
/* determine the full screen color blend /* determine the full screen color blend
must be after viewoffset, so eye contents can be must be after viewoffset, so eye contents can be
accurately determined */ accurately determined */
SV_CalcBlend(ent); SV_CalcBlend(ent);

View file

@ -214,7 +214,7 @@ Pickup_Weapon(edict_t *ent, edict_t *other)
} }
/* /*
* The old weapon has been dropped all the * The old weapon has been dropped all the
* way, so make the new one current * way, so make the new one current
*/ */
void void
@ -1523,9 +1523,9 @@ weapon_supershotgun_fire(edict_t *ent)
v[YAW] = ent->client->v_angle[YAW] - 5; v[YAW] = ent->client->v_angle[YAW] - 5;
v[ROLL] = ent->client->v_angle[ROLL]; v[ROLL] = ent->client->v_angle[ROLL];
AngleVectors(v, forward, NULL, NULL); AngleVectors(v, forward, NULL, NULL);
if (aimfix->value) if (aimfix->value)
{ {
AngleVectors(v, forward, right, NULL); AngleVectors(v, forward, right, NULL);
VectorScale(forward, -2, ent->client->kick_origin); VectorScale(forward, -2, ent->client->kick_origin);
@ -1533,16 +1533,16 @@ weapon_supershotgun_fire(edict_t *ent)
VectorSet(offset, 0, 8, ent->viewheight - 8); VectorSet(offset, 0, 8, ent->viewheight - 8);
P_ProjectSource(ent, offset, forward, right, start); P_ProjectSource(ent, offset, forward, right, start);
} }
fire_shotgun(ent, start, forward, damage, kick, DEFAULT_SHOTGUN_HSPREAD, fire_shotgun(ent, start, forward, damage, kick, DEFAULT_SHOTGUN_HSPREAD,
DEFAULT_SHOTGUN_VSPREAD, DEFAULT_SSHOTGUN_COUNT / 2, MOD_SSHOTGUN); DEFAULT_SHOTGUN_VSPREAD, DEFAULT_SSHOTGUN_COUNT / 2, MOD_SSHOTGUN);
v[YAW] = ent->client->v_angle[YAW] + 5; v[YAW] = ent->client->v_angle[YAW] + 5;
AngleVectors(v, forward, NULL, NULL); AngleVectors(v, forward, NULL, NULL);
if (aimfix->value) if (aimfix->value)
{ {
AngleVectors(v, forward, right, NULL); AngleVectors(v, forward, right, NULL);
VectorScale(forward, -2, ent->client->kick_origin); VectorScale(forward, -2, ent->client->kick_origin);
@ -1550,8 +1550,8 @@ weapon_supershotgun_fire(edict_t *ent)
VectorSet(offset, 0, 8, ent->viewheight - 8); VectorSet(offset, 0, 8, ent->viewheight - 8);
P_ProjectSource(ent, offset, forward, right, start); P_ProjectSource(ent, offset, forward, right, start);
} }
fire_shotgun(ent, start, forward, damage, kick, fire_shotgun(ent, start, forward, damage, kick,
DEFAULT_SHOTGUN_HSPREAD, DEFAULT_SHOTGUN_VSPREAD, DEFAULT_SHOTGUN_HSPREAD, DEFAULT_SHOTGUN_VSPREAD,
DEFAULT_SSHOTGUN_COUNT / 2, MOD_SSHOTGUN); DEFAULT_SSHOTGUN_COUNT / 2, MOD_SSHOTGUN);
@ -1599,7 +1599,7 @@ weapon_railgun_fire(edict_t *ent)
int kick; int kick;
if (deathmatch->value) if (deathmatch->value)
{ {
/* normal damage is too extreme in dm */ /* normal damage is too extreme in dm */
damage = 100; damage = 100;
kick = 200; kick = 200;
@ -1689,7 +1689,7 @@ weapon_bfg_fire(edict_t *ent)
return; return;
} }
/* cells can go down during windup (from power armor hits), so /* cells can go down during windup (from power armor hits), so
check again and abort firing if we don't have enough now */ check again and abort firing if we don't have enough now */
if (ent->client->pers.inventory[ent->client->ammo_index] < 50) if (ent->client->pers.inventory[ent->client->ammo_index] < 50)
{ {

View file

@ -26,9 +26,9 @@
#include "../header/local.h" #include "../header/local.h"
/* Note that the pmenu entries are duplicated /* Note that the pmenu entries are duplicated
this is so that a static set of pmenu entries can be used this is so that a static set of pmenu entries can be used
for multiple clients and changed without interference for multiple clients and changed without interference
note that arg will be freed when the menu is closed, it note that arg will be freed when the menu is closed, it
must be allocated memory */ must be allocated memory */
pmenuhnd_t * pmenuhnd_t *
@ -133,8 +133,8 @@ PMenu_Close(edict_t *ent)
ent->client->showscores = false; ent->client->showscores = false;
} }
/* /*
* Only use on pmenu's that have been called with PMenu_Open * Only use on pmenu's that have been called with PMenu_Open
*/ */
void void
PMenu_UpdateEntry(pmenu_t *entry, const char *text, int align, PMenu_UpdateEntry(pmenu_t *entry, const char *text, int align,

View file

@ -328,7 +328,7 @@ static mframe_t floater_frames_attack1a[] =
{ai_charge, 10, NULL} // -- LOOP Ends {ai_charge, 10, NULL} // -- LOOP Ends
}; };
mmove_t floater_move_attack1a = mmove_t floater_move_attack1a =
{ {
FRAME_attak101, FRAME_attak101,
FRAME_attak114, FRAME_attak114,

View file

@ -2118,9 +2118,9 @@ weapon_supershotgun_fire(edict_t *ent)
v[YAW] = ent->client->v_angle[YAW] - 5; v[YAW] = ent->client->v_angle[YAW] - 5;
v[ROLL] = ent->client->v_angle[ROLL]; v[ROLL] = ent->client->v_angle[ROLL];
AngleVectors(v, forward, NULL, NULL); AngleVectors(v, forward, NULL, NULL);
if (aimfix->value) if (aimfix->value)
{ {
AngleVectors(v, forward, right, NULL); AngleVectors(v, forward, right, NULL);
VectorScale(forward, -2, ent->client->kick_origin); VectorScale(forward, -2, ent->client->kick_origin);
@ -2128,17 +2128,17 @@ weapon_supershotgun_fire(edict_t *ent)
VectorSet(offset, 0, 8, ent->viewheight - 8); VectorSet(offset, 0, 8, ent->viewheight - 8);
P_ProjectSource(ent, offset, forward, right, start); P_ProjectSource(ent, offset, forward, right, start);
} }
fire_shotgun(ent, start, forward, damage, kick, fire_shotgun(ent, start, forward, damage, kick,
DEFAULT_SHOTGUN_HSPREAD, DEFAULT_SHOTGUN_VSPREAD, DEFAULT_SHOTGUN_HSPREAD, DEFAULT_SHOTGUN_VSPREAD,
DEFAULT_SSHOTGUN_COUNT / 2, MOD_SSHOTGUN); DEFAULT_SSHOTGUN_COUNT / 2, MOD_SSHOTGUN);
v[YAW] = ent->client->v_angle[YAW] + 5; v[YAW] = ent->client->v_angle[YAW] + 5;
AngleVectors(v, forward, NULL, NULL); AngleVectors(v, forward, NULL, NULL);
if (aimfix->value) if (aimfix->value)
{ {
AngleVectors(v, forward, right, NULL); AngleVectors(v, forward, right, NULL);
VectorScale(forward, -2, ent->client->kick_origin); VectorScale(forward, -2, ent->client->kick_origin);
@ -2146,8 +2146,8 @@ weapon_supershotgun_fire(edict_t *ent)
VectorSet(offset, 0, 8, ent->viewheight - 8); VectorSet(offset, 0, 8, ent->viewheight - 8);
P_ProjectSource(ent, offset, forward, right, start); P_ProjectSource(ent, offset, forward, right, start);
} }
fire_shotgun(ent, start, forward, damage, kick, fire_shotgun(ent, start, forward, damage, kick,
DEFAULT_SHOTGUN_HSPREAD, DEFAULT_SHOTGUN_VSPREAD, DEFAULT_SHOTGUN_HSPREAD, DEFAULT_SHOTGUN_VSPREAD,
DEFAULT_SSHOTGUN_COUNT / 2, MOD_SSHOTGUN); DEFAULT_SSHOTGUN_COUNT / 2, MOD_SSHOTGUN);

View file

@ -371,7 +371,7 @@ SV_Kick_f(void)
SV_BroadcastPrintf(PRINT_HIGH, "%s was kicked\n", sv_client->name); SV_BroadcastPrintf(PRINT_HIGH, "%s was kicked\n", sv_client->name);
} }
/* print directly, because the dropped client /* print directly, because the dropped client
won't get the SV_BroadcastPrintf message */ won't get the SV_BroadcastPrintf message */
SV_ClientPrintf(sv_client, PRINT_HIGH, "You were kicked from the game\n"); SV_ClientPrintf(sv_client, PRINT_HIGH, "You were kicked from the game\n");
SV_DropClient(sv_client); SV_DropClient(sv_client);
@ -564,8 +564,8 @@ SV_ServerRecord_f(void)
return; return;
} }
if (strstr(Cmd_Argv(1), "..") || if (strstr(Cmd_Argv(1), "..") ||
strstr(Cmd_Argv(1), "/") || strstr(Cmd_Argv(1), "/") ||
strstr(Cmd_Argv(1), "\\")) strstr(Cmd_Argv(1), "\\"))
{ {
Com_Printf("Illegal filename.\n"); Com_Printf("Illegal filename.\n");

View file

@ -92,7 +92,7 @@ SV_EmitPacketEntities(client_frame_t *from, client_frame_t *to, sizebuf_t *msg)
if (newnum == oldnum) if (newnum == oldnum)
{ {
/* delta update from old position. because the force /* delta update from old position. because the force
parm is false, this will not result in any bytes parm is false, this will not result in any bytes
being emited if the entity has not changed at all being emited if the entity has not changed at all
note that players are always 'newentities', this note that players are always 'newentities', this
@ -563,7 +563,7 @@ SV_BuildClientFrame(client_t *client)
} }
/* ignore ents without visible models unless they have an effect */ /* ignore ents without visible models unless they have an effect */
if (!ent->s.modelindex && !ent->s.effects && if (!ent->s.modelindex && !ent->s.effects &&
!ent->s.sound && !ent->s.event) !ent->s.sound && !ent->s.event)
{ {
continue; continue;
@ -627,7 +627,7 @@ SV_BuildClientFrame(client_t *client)
if (!ent->s.modelindex) if (!ent->s.modelindex)
{ {
/* don't send sounds if they /* don't send sounds if they
will be attenuated away */ will be attenuated away */
vec3_t delta; vec3_t delta;
float len; float len;

View file

@ -331,8 +331,8 @@ SV_StartSound(vec3_t origin, edict_t *entity, int channel, int soundindex,
flags |= SND_ATTENUATION; flags |= SND_ATTENUATION;
} }
/* the client doesn't know that bmodels have /* the client doesn't know that bmodels have
weird origins the origin can also be weird origins the origin can also be
explicitly set */ explicitly set */
if ((entity->svflags & SVF_NOCLIENT) || if ((entity->svflags & SVF_NOCLIENT) ||
(entity->solid == SOLID_BSP) || (entity->solid == SOLID_BSP) ||
@ -580,8 +580,8 @@ SV_SendClientMessages(void)
continue; continue;
} }
/* if the reliable message /* if the reliable message
overflowed, drop the overflowed, drop the
client */ client */
if (c->netchan.message.overflowed) if (c->netchan.message.overflowed)
{ {

View file

@ -13,7 +13,7 @@
* $ gcc -Wall -o quake2.exe wrapper.c * $ gcc -Wall -o quake2.exe wrapper.c
* in our mingw build environment, will only depend on kernel32.dll and MSVCRT.DLL then, * in our mingw build environment, will only depend on kernel32.dll and MSVCRT.DLL then,
* which should be available on every Windows installation. * which should be available on every Windows installation.
* *
* (C) 2017 Daniel Gibson * (C) 2017 Daniel Gibson
* License: * License:
* This software is dual-licensed to the public domain and under the following * This software is dual-licensed to the public domain and under the following