Skip to content

Conversation

@WereTech
Copy link

@WereTech WereTech commented Nov 8, 2025

This will allow creators to decide whether or not the player is allowed to take damage while using a point_viewcontrol. However, this still creates the issue of the player's current view entity not being reset by default and needs an explicit call for Disable or resetting the view entity back to the player. If pulled in conjunction with my other pull request at #1634, this handling can be done a bit better as it removes the IsAlive check from the Disable function so it could be disabled immediately on death instead of needing to wait until the player has respawned (if they are allowed to).

// Make the player invulnerable while under control of the camera. This will prevent situations where the player dies while under camera control but cannot restart their game due to disabled player inputs.
m_nOldTakeDamage = m_hPlayer->m_takedamage;
m_hPlayer->m_takedamage = DAMAGE_NO;
if ( HasSpawnFlags( SF_CAMERA_PLAYER_INVULN ) )
Copy link
Contributor

@ficool2 ficool2 Nov 10, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This condition needs to be inverted for backwards compatibility (and rename the flag accodingly). The previous behavior should exist for old maps.
It also shouldn't revert the m_takeDamage when Disabling in this case

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Made the changes

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants