File tree Expand file tree Collapse file tree 3 files changed +21
-16
lines changed Expand file tree Collapse file tree 3 files changed +21
-16
lines changed Original file line number Diff line number Diff line change @@ -348,8 +348,8 @@ noref float(string cmd) CSQC_ConsoleCommand = {
348
348
case PC_ENGINEER:
349
349
if (previewing_sentry) {
350
350
sentry_preview_offset = anglemod(sentry_preview_offset - 15);
351
- } else {
352
- update_sentry_angles = time + 0.5 ;
351
+ } else if (vlen(PM_Org() - sentry_pos) < ENG_BUILDING_DISMANTLE_DISTANCE) {
352
+ update_sentry_angles = time + 0.55 ;
353
353
sentry_angles_y = anglemod(sentry_angles_y - 15);
354
354
localcmd(sprintf("cmd sentry angle %f\n", sentry_angles_y));
355
355
}
@@ -361,8 +361,8 @@ noref float(string cmd) CSQC_ConsoleCommand = {
361
361
case PC_ENGINEER:
362
362
if (previewing_sentry) {
363
363
sentry_preview_offset = anglemod(sentry_preview_offset + 15);
364
- } else {
365
- update_sentry_angles = time + 0.5 ;
364
+ } else if (vlen(PM_Org() - sentry_pos) < ENG_BUILDING_DISMANTLE_DISTANCE) {
365
+ update_sentry_angles = time + 0.55 ;
366
366
sentry_angles_y = anglemod(sentry_angles_y + 15);
367
367
localcmd(sprintf("cmd sentry angle %f\n", sentry_angles_y));
368
368
}
Original file line number Diff line number Diff line change @@ -626,6 +626,11 @@ void (float objtobuild, float offset) TeamFortress_Build = {
626
626
}
627
627
628
628
UpdateClientBuilding(self);
629
+
630
+ if (objtobuild == BUILD_SENTRYGUN) {
631
+ UpdateClient_Sentry(self, newmis);
632
+ }
633
+
629
634
self.is_building = objtobuild;
630
635
if (!engineer_move) {
631
636
self.immune_to_check = time + 5;
@@ -929,18 +934,6 @@ void () DispenserThink = {
929
934
self.nextthink = time + 0.3;
930
935
};
931
936
932
- void UpdateClient_Sentry(entity pl, entity sent) = {
933
- if(!infokeyf(pl, INFOKEY_P_CSQCACTIVE))
934
- return;
935
- msg_entity = pl;
936
- WriteByte(MSG_MULTICAST, SVC_CGAMEPACKET);
937
- WriteByte(MSG_MULTICAST, MSG_SENTRY_POS);
938
- WriteFloat(MSG_MULTICAST, sent.origin.x);
939
- WriteFloat(MSG_MULTICAST, sent.origin.y);
940
- WriteFloat(MSG_MULTICAST, sent.origin.z);
941
- multicast('0 0 0', MULTICAST_ONE_NOSPECS);
942
- }
943
-
944
937
void UpdateClient_Dispenser(entity pl, entity disp) = {
945
938
if(!infokeyf(pl, INFOKEY_P_CSQCACTIVE))
946
939
return;
Original file line number Diff line number Diff line change @@ -767,6 +767,18 @@ void UpdateClientBuilding(entity pl) {
767
767
multicast('0 0 0', MULTICAST_ONE_NOSPECS);
768
768
}
769
769
770
+ void UpdateClient_Sentry(entity pl, entity sent) = {
771
+ if(!infokeyf(pl, INFOKEY_P_CSQCACTIVE))
772
+ return;
773
+ msg_entity = pl;
774
+ WriteByte(MSG_MULTICAST, SVC_CGAMEPACKET);
775
+ WriteByte(MSG_MULTICAST, MSG_SENTRY_POS);
776
+ WriteFloat(MSG_MULTICAST, sent.origin.x);
777
+ WriteFloat(MSG_MULTICAST, sent.origin.y);
778
+ WriteFloat(MSG_MULTICAST, sent.origin.z);
779
+ multicast('0 0 0', MULTICAST_ONE_NOSPECS);
780
+ }
781
+
770
782
void UpdateClientReloadSound(entity pl, float weapon) {
771
783
if(!infokeyf(pl, INFOKEY_P_CSQCACTIVE))
772
784
return;
You can’t perform that action at this time.
0 commit comments