New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Streamline and better options for healthstation #1274

Merged
merged 2 commits into from Nov 14, 2016

Conversation

Projects
None yet
4 participants
@nubpro
Contributor

nubpro commented Nov 12, 2016

Streamlined damage logs and added a convar option to allow or disallow detective to damage their own health station. By default, they can't.

Thanks!

Streamline and better options
Streamlined damage logs and added a convar option to allow or disallow detective to damage their own health station. By default, they can't.

@robotboy655 robotboy655 added the TTT label Nov 12, 2016

@bmwalters

This comment has been minimized.

Contributor

bmwalters commented Nov 13, 2016

In the future, when you create a pull request that does multiple things, changes should be in separate commits for clarity. For example, I would create one commit that moves the OnTakeDamage function into the if SERVER block, one commit that changes the DamageLog format, and one that adds the ConVar, instead of putting it in one commit and putting this information in the description.

As far as the actual change, the name "ttt_detective_dmg_selfhs" is a bit cumbersome, perhaps "ttt_damage_own_healthstation" is better?

local att = dmginfo:GetAttacker()
local placer = self:GetPlacer()
if IsPlayer(att) then
DamageLog(Format("DMG: \t %s [%s] damaged health station [%s] for %d dmg", att:Nick(), att:GetRoleString(), placer:Nick(), dmginfo:GetDamage()))

This comment has been minimized.

@svdm

svdm Nov 13, 2016

Collaborator

You'll have to check here if IsPlayer(placer), because that player may have disconnected after placing the health station. If I recall correctly, other damagelog messages tend to print something like "disconnected" as the nickname if that happens.

local ttt_detective_dmg_selfhs = CreateConVar("ttt_detective_dmg_selfhs", "0") -- 0 as detective cannot damage their own health station

This comment has been minimized.

@svdm

svdm Nov 13, 2016

Collaborator

The suggested ttt_damage_own_healthstation would be more clear

@nubpro

This comment has been minimized.

Contributor

nubpro commented Nov 13, 2016

Thank you so much for the feedback, I've modified the scripts accordingly.

@svdm svdm merged commit f775a5c into Facepunch:master Nov 14, 2016

@nubpro nubpro changed the title from Streamline and better options to Streamline and better options for healthstation Dec 3, 2016

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