Skip to content

Make 3rd party corpses invisible till they in fov#544

Merged
majcosta merged 3 commits into
1dot13:masterfrom
steph-pg:prevent_rendering_unseen_corpses
Oct 14, 2025
Merged

Make 3rd party corpses invisible till they in fov#544
majcosta merged 3 commits into
1dot13:masterfrom
steph-pg:prevent_rendering_unseen_corpses

Conversation

@steph-pg
Copy link
Copy Markdown
Contributor

@steph-pg steph-pg commented Oct 11, 2025

when non player soldier dies the corpse is rendered even if we can't see it. For example when you, soldiers, and blood cats are in the same sector and goon got killed the corpse is rendered even if your team can't see it at all. With this change such corpses won't be rendered right away, but they become visible when you come over them

Comment thread Tactical/Rotting Corpses.cpp Outdated
Comment on lines +2530 to +2534
pCorpse = GetCorpseAtGridNo(sGridNo, ubLevel);
if (pCorpse == NULL)
{
return;
}
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

this code already exists just 14 lines below. just put your if statement after it and delete this

// If this is our guy......make visible...
//if ( pSoldier->bTeam == gbPlayerNum )
if ( iCorpseID != -1 )
if ( iCorpseID != -1 && pSoldier->bTeam == OUR_TEAM || gbPublicOpplist[OUR_TEAM][pSoldier->ubID] == SEEN_CURRENTLY )
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

I'm not familiar with this, does gbPublicOpplist[OUR_TEAM][pSoldier->ubID] == SEEN_CURRENTLY evaluate to false if the corpse isn't on anyone's line of sight?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

The idea here is to render immediately only those of our team and of those enemies we currently see

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

I get the idea, I just don't know how it works.

@steph-pg steph-pg requested a review from majcosta October 13, 2025 16:30
Comment thread Tactical/Rotting Corpses.cpp Outdated
INT8 bToleranceThreshold = 0;
SOLDIERTYPE *pTeamSoldier;


Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Remove newline, please

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

@majcosta majcosta merged commit 1e1eb88 into 1dot13:master Oct 14, 2025
@steph-pg steph-pg deleted the prevent_rendering_unseen_corpses branch October 15, 2025 05:26
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