[TF2] Allow null caller on team_control_point's SetOwner input #1530
+1
−6
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
team_control_pointhas a SetOwner input for manually changing a point's ownership to a specified team. This input will credit a player for capturing the point if that player is the caller. If the calling entity is not a player, no credit is given.However, there is an additional guard and assert against null callers which unexpectedly prevents the point from changing ownership at all. Given that nothing happens with the caller unless that caller is a player, these checks don't appear to serve any purpose beyond what the IsPlayer check already achieves.
This PR removes the guard and assert, incorporating the null-check alongside the IsPlayer check.
An easy way to test this PR is to use the following command in console on a koth map. Do not use
ent_fireas that sets you as the caller.script Entities.FindByClassname(null, "team_control_point").AcceptInput("SetOwner", "3", null, null)