Skip to content

Commit c38b1b4

Browse files
author
newby
committed
Remove "non-precise" grenades
Now that we're happy with the new behavior and there's no differences from the old beyond precision, eliminate the old code and precise grenade option, there are now only "FO Grenades".
1 parent d8a3ba7 commit c38b1b4

File tree

2 files changed

+8
-39
lines changed

2 files changed

+8
-39
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ New features
77
* `localinfo project_grenades 0/1` [default: 0] Adjust the point at which
88
grenades are primed to correct for client latency. Does not allow players to
99
throw grenades any faster, or more frequently; only more consistently.
10-
* `setinfo precise_grenades on/off` to enable precise timing when throwing grenades. This removes a random, up to, 100ms input delay. (default on)
10+
* Server option to limit `sv_maxclients` to current number of players during quad gametime. `localinfo limit_quad_players 0/1`. Default: `1`.
1111
* `localinfo forcereload 0/1` Option to prevent forced reloads.
1212
* `+grenade1` and `+grenade2` grenade buttons (more reliable than impulses), push to prime, again to throw.
1313
* `+dropflag` Allows player to hold button and flag will be thrown on contact.

ssqc/tfort.qc

Lines changed: 7 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -932,9 +932,7 @@ void (float inp) TeamFortress_PrimeThrowGrenade = {
932932
}
933933
};
934934

935-
void () TeamFortress_GrenadePrimedThink;
936-
void () FO_PreciseGrenadeThink;
937-
float () FO_UsePreciseGrenades;
935+
void () FO_GrenadeThink;
938936

939937
// is_player defines whether this originated from the player or server. Player
940938
// generated primes are corrected for latency when project_grenades is on.
@@ -1130,39 +1128,12 @@ void (float inp, float is_player) TeamFortress_PrimeGrenade = {
11301128
}
11311129
}
11321130

1133-
if (FO_UsePreciseGrenades())
1134-
tGrenade.think = FO_PreciseGrenadeThink;
1135-
else
1136-
tGrenade.think = TeamFortress_GrenadePrimedThink;
1131+
tGrenade.think = FO_GrenadeThink;
11371132
self.grenade_timer = tGrenade;
11381133
};
11391134

1140-
void () TeamFortress_GrenadePrimedThink = {
1141-
local entity user;
1142-
1143-
user = self.owner;
1144-
if (!(user.tfstate & TFSTATE_GRENTHROWING) && !user.deadflag && !user.has_disconnected) {
1145-
self.nextthink = time + 0.1;
1146-
if (!self.think)
1147-
dremove(self);
1148-
1149-
if (time > self.heat && self.weapon != GR_TYPE_CALTROP)
1150-
TeamFortress_ExplodePerson();
1151-
1152-
return;
1153-
}
1154-
if (!(user.tfstate & TFSTATE_GRENPRIMED))
1155-
dprint("GrenadePrimed logic error\n");
1156-
1157-
FO_SpawnThrownGrenade(self);
1158-
dremove(self);
1159-
};
1160-
1161-
float () FO_UsePreciseGrenades = {
1162-
return FO_GetUserSetting(self, "precise_grenades", "pg", "on");
1163-
}
11641135

1165-
void () FO_PreciseGrenadeThink = {
1136+
void () FO_GrenadeThink = {
11661137
local entity user = self.owner;
11671138

11681139
// Claim: These cases do not exist for FO; to be removed once proven true.
@@ -1186,12 +1157,13 @@ void () FO_PreciseGrenadeThink = {
11861157
self.nextthink = self.heat;
11871158
}
11881159
} else {
1189-
TeamFortress_ExplodePerson();
1160+
if (self.weapon != GR_TYPE_CALTROP)
1161+
TeamFortress_ExplodePerson();
11901162
dremove(self);
11911163
}
11921164
}
11931165

1194-
void () FO_ThrowPreciseGrenade = {
1166+
void () FO_ThrowGrenade = {
11951167
local entity timer = self.grenade_timer;
11961168
if (timer.nextthink != timer.heat || timer.heat - time < 0.1) {
11971169
// We do not allow throwing within the first second, or the last 0.1.
@@ -1212,10 +1184,7 @@ void () TeamFortress_ThrowGrenade = {
12121184
return;
12131185

12141186
self.tfstate |= TFSTATE_GRENTHROWING;
1215-
// While this is controlled by localinfo, it's a per-grenade value.
1216-
if (FO_UsePreciseGrenades() &&
1217-
self.grenade_timer.think == FO_PreciseGrenadeThink)
1218-
FO_ThrowPreciseGrenade();
1187+
FO_ThrowGrenade();
12191188
};
12201189

12211190
void () TeamFortress_GrenadeSwitch = {

0 commit comments

Comments
 (0)