Skip to content

Commit ac42d6e

Browse files
authored
CLIENT/SERVER: Add new networked fields for viewmodels (#145)
1 parent c2c3d9a commit ac42d6e

5 files changed

Lines changed: 18 additions & 2 deletions

File tree

source/client/view_model.qc

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -275,6 +275,14 @@ void() ViewModel_Draw =
275275
cl_viewent.renderflags = cl_viewent2.renderflags = RF_VIEWMODEL;
276276
}
277277

278+
if (getstatf(STAT_VIEWMODEL_EFFECTS) & EF_FULLBRIGHT) {
279+
cl_viewent.effects = EF_FULLBRIGHT;
280+
}
281+
282+
if (getstatf(STAT_VIEWMODEL2_EFFECTS) & EF_FULLBRIGHT) {
283+
cl_viewent2.effects = EF_FULLBRIGHT;
284+
}
285+
278286
// If we're zoomed in with a Sniper scope or r_drawviewmodel is false, early-out.
279287
if (!cvar("r_drawviewmodel") || getstatf(STAT_WEAPONZOOM) == 2 || cvar("chase_active"))
280288
return;

source/server/defs/custom.qc

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -188,6 +188,8 @@ void (float shotcount, float sprd, float Damage, float side) FireTrace;
188188
.float weapon2frame;
189189
.float reloadinterupted;
190190
.float hitcount;
191+
.float viewmodel_effects;
192+
.float viewmodel2_effects;
191193

192194
#ifdef FTE
193195

source/server/defs/standard.qc

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -151,6 +151,8 @@ void end_sys_globals; // flag for structure dumping
151151
.string Weapon_Name;
152152
.string Weapon_Name_Touch;
153153
.float currentmag2;
154+
.float viewmodel_effects;
155+
.float viewmodel2_effects;
154156
.float maxspeed;
155157
.float facingenemy;
156158
.float scale;

source/server/main.qc

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -389,6 +389,8 @@ void() worldspawn =
389389
clientstat(STAT_WEAPONNAME, EV_STRING, Weapon_Name);
390390
clientstat(STAT_WEAPONNAMETOUCH, EV_STRING, Weapon_Name_Touch);
391391
clientstat(STAT_WEAPONTIER, EV_FLOAT, weapon_tier);
392+
clientstat(STAT_VIEWMODEL_EFFECTS, EV_FLOAT, viewmodel_effects);
393+
clientstat(STAT_VIEWMODEL2_EFFECTS, EV_FLOAT, viewmodel2_effects);
392394

393395
// Gun Game
394396
clientstat(STAT_GUNGAME_IDX, EV_FLOAT, gungame_weapon_idx);

source/shared/shared_defs.qc

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -335,9 +335,11 @@ float map_compatibility_mode;
335335
#define STAT_WEAPONNAME 71
336336
#define STAT_WEAPONNAMETOUCH 72
337337
#define STAT_WEAPONTIER 73
338+
#define STAT_VIEWMODEL_EFFECTS 74
339+
#define STAT_VIEWMODEL2_EFFECTS 75
338340

339-
#define STAT_GUNGAME_IDX 74
340-
#define STAT_GUNGAME_SCOREGOAL 75
341+
#define STAT_GUNGAME_IDX 76
342+
#define STAT_GUNGAME_SCOREGOAL 77
341343

342344
// Game Modes
343345
#define GAMEMODE_CLASSIC 0

0 commit comments

Comments
 (0)