Skip to content

Commit 6d6b301

Browse files
committed
Handle rotating sentry base
1 parent 8300424 commit 6d6b301

File tree

1 file changed

+19
-2
lines changed

1 file changed

+19
-2
lines changed

csqc/tfx.qc

Lines changed: 19 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -265,7 +265,7 @@ float UpdateFlag(float isnew) {
265265
return TRUE;
266266
}
267267

268-
float UpdateTurret(float isnew) {
268+
float UpdateSentry(float isnew) {
269269
if (isnew) {
270270
sentry_angles_y = self.angles_y;
271271
} else {
@@ -279,6 +279,22 @@ float UpdateTurret(float isnew) {
279279
return TRUE;
280280
}
281281

282+
float UpdateSentryBase(float isnew) {
283+
if (isnew) {
284+
sentry_angles_y = self.angles_y;
285+
} else {
286+
if (!SBAR.SentryLevel && SBAR.IsBuilding) {
287+
if (update_sentry_angles > time) {
288+
self.angles_y = sentry_angles_y;
289+
} else {
290+
sentry_angles_y = self.angles_y;
291+
}
292+
}
293+
}
294+
295+
return TRUE;
296+
}
297+
282298
void TFxGrenTimerUpdate(float ent_num, float expiry) {
283299
EntHash* he = EntGet(ent_num);
284300
he->grentimer_expires = expiry;
@@ -325,5 +341,6 @@ void TF_Init() {
325341

326342
shader_over_outline = shaderforname(rnds("over_outline"), "{ sort 7 }");
327343
#endif
328-
deltalisten("progs/turrgun.mdl", UpdateTurret, 0);
344+
deltalisten("progs/turrgun.mdl", UpdateSentry, 0);
345+
deltalisten("progs/turrbase.mdl", UpdateSentryBase, 0);
329346
}

0 commit comments

Comments
 (0)