TTT: Some Changes #1234

Merged
merged 1 commit into from Sep 1, 2016

Projects

None yet

6 participants

@markusmarkusz
Contributor
markusmarkusz commented Aug 26, 2016 edited

Because I have made several different changes in this Pull Request, I list them as concise as possible.

  • GM.Customized got removed because it is from an older version.
  • The mute variables refer now to the team variables.
  • Added a ShouldScore() query at the point there deaths got added. (This helps some addons like the Power Round Addon.)
  • Disabled the Muzzle Flashes for weapons, that don't need them.
  • Made PrintTraitors(ply), PrintGroups(ply) and PrintReport(ply) to local functions. I thought about if they have to be global.
  • Added a query so detectives are shown as detectives not as innocents.

(I squash the commits if this got aproved.)

@Kefta
Contributor
Kefta commented Aug 26, 2016

Turning off CSMuzzleFlashes doesn't stop muzzle flashes; it's a variable that won't be used with non-guns. Best to just cut it out

@bmwalters bmwalters commented on an outdated diff Aug 26, 2016
garrysmod/gamemodes/terrortown/gamemode/shared.lua
@@ -218,3 +210,9 @@ DefaultEquipment = {
"weapon_ttt_glock"
}
};
+
+-- Mute types
+MUTE_NONE = 0
+MUTE_TERROR = TEAM_TERROR
+MUTE_ALL = 2
+MUTE_SPEC = TEAM_SPEC
@bmwalters
bmwalters Aug 26, 2016 edited Contributor

I feel like this is error prone. It might be less error prone to have ALL equal the bitwise OR of TEAM_TERROR and TEAM_SPEC but numbers are probably better and make more sense simply by the fact that separate enums shouldn't depend on each other.

@bmwalters
bmwalters Aug 26, 2016 edited Contributor

Actually I just read the code and wow, it actually checks the team against the MUTE_ enum.
https://github.com/garrynewman/garrysmod/blob/master/garrysmod/gamemodes/terrortown/gamemode/gamemsg.lua#L189
That's kind of silly, why even have this enum? Just use bit flags of the TEAM_ enums and check if the player's :Team() is present in there.

@markusmarkusz
Contributor

Better?

@robotboy655 robotboy655 added the TTT label Aug 26, 2016
@bmwalters
Contributor
bmwalters commented Aug 26, 2016 edited

That's not what I meant; I meant to remove the team enums entirely, and use bitwise operators to combine which teams are muted. 0 = no teams muted, TEAM_TERROR | TEAM_SPEC = all muted, etc

@svdm
Collaborator
svdm commented Aug 28, 2016

The vast majority of these changes are pointless messing around, tweaking tiny things for the sake of changing something. As I've said in previous PRs, I'm not interested in merging that type of thing.

The only legitimate fix I'll accept is the ShouldScore one.

@markusmarkusz
Contributor
markusmarkusz commented Aug 28, 2016 edited

@svdm
Okay.
I'll remove the other things from this PR later.

@svdm svdm merged commit 31ed1d8 into garrynewman:master Sep 1, 2016
@markusmarkusz markusmarkusz deleted the unknown repository branch Sep 10, 2016
@nubpro
Contributor
nubpro commented Oct 10, 2016 edited

May I know how exactly can we benefit from this?
It's a little vague.

@Kefta
Contributor
Kefta commented Oct 10, 2016 edited

It's just code cleanup

@nubpro
Contributor
nubpro commented Oct 10, 2016

I mean "Added a ShouldScore() query at the point there deaths got added. (This helps some addons like the Power Round Addon.)"

@markusmarkusz
Contributor

@nubpro
As an example:
With the Power Rounds Addon (https://scriptfodder.com/scripts/view/401/power-rounds-murdertttphjbmbdrgw) you can create special rounds, like Deathmatch Rounds.
But if you just temporary override the ShouldScore() function, then only the points (frags) got blocked. But not the deaths.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment