mirror of
https://github.com/openmoh/openmohaa.git
synced 2025-04-28 13:47:58 +03:00
Set the render effect of skyportal and skyentity when adding them to the snapshot
This fixes the issue where some entities like effects would be visible through the sky
This commit is contained in:
parent
737ee3af64
commit
db6ff8901b
1 changed files with 12 additions and 2 deletions
|
@ -444,6 +444,8 @@ SV_AddEntToSnapshot
|
|||
static void SV_AddEntToSnapshot( svEntity_t *svEnt, gentity_t *gEnt, snapshotEntityNumbers_t *eNums, svEntity_t* portalEnt, qboolean portalsky) {
|
||||
// if we have already added this entity to this snapshot, don't add again
|
||||
if ( svEnt->snapshotCounter == sv.snapshotCounter ) {
|
||||
gEnt->s.renderfx &= ~RF_SHADOW_PLANE;
|
||||
gEnt->s.renderfx |= RF_WRAP_FRAMES;
|
||||
return;
|
||||
}
|
||||
svEnt->snapshotCounter = sv.snapshotCounter;
|
||||
|
@ -453,6 +455,14 @@ static void SV_AddEntToSnapshot( svEntity_t *svEnt, gentity_t *gEnt, snapshotEnt
|
|||
return;
|
||||
}
|
||||
|
||||
gEnt->s.renderfx &= ~(RF_SHADOW_PLANE | RF_WRAP_FRAMES | RF_SKYENTITY);
|
||||
|
||||
if ( portalEnt ) {
|
||||
gEnt->s.renderfx |= RF_SHADOW_PLANE;
|
||||
} else if ( portalsky ) {
|
||||
gEnt->s.renderfx |= RF_SKYENTITY;
|
||||
}
|
||||
|
||||
gEnt->r.lastNetTime = svs.time - svs.startTime;
|
||||
eNums->snapshotEntities[ eNums->numSnapshotEntities ] = gEnt->s.number;
|
||||
eNums->numSnapshotEntities++;
|
||||
|
@ -619,7 +629,7 @@ static void SV_AddEntitiesVisibleFromPoint(const vec3_t origin, clientSnapshot_t
|
|||
// broadcast entities are always sent
|
||||
// or broadcast entities that are sent once
|
||||
if ( (ent->r.svFlags & SVF_BROADCAST) || (ent->r.svFlags & SVF_SENDONCE) ) {
|
||||
SV_AddEntToSnapshot( svEnt, ent, eNums, NULL, qfalse);
|
||||
SV_AddEntToSnapshot( svEnt, ent, eNums, portalEnt, portalsky);
|
||||
continue;
|
||||
}
|
||||
|
||||
|
@ -717,7 +727,7 @@ static void SV_AddEntitiesVisibleFromPoint(const vec3_t origin, clientSnapshot_t
|
|||
}
|
||||
|
||||
// add it
|
||||
SV_AddEntToSnapshot( svEnt, ent, eNums, NULL, qfalse);
|
||||
SV_AddEntToSnapshot( svEnt, ent, eNums, portalEnt, portalsky);
|
||||
|
||||
// if its a portal entity, add everything visible from its camera position
|
||||
if ( ent->r.svFlags & SVF_PORTAL && svEnt != portalEnt ) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue