Fix long-standing visual bug with pulsegun beam (thanks, RELATIVETOFLOOR flag).

This commit is contained in:
Marisa the Magician 2019-02-02 19:59:20 +01:00
commit c24834d778
2 changed files with 2 additions and 6 deletions

View file

@ -79,9 +79,3 @@ This mod requires GZDoom 3.7.0 or later.
- Biorifle sludge doesn't handle 3d floors (especially sloped ones) properly. - Biorifle sludge doesn't handle 3d floors (especially sloped ones) properly.
This is due to the unavailability of 3D floor data on ZScript and will be This is due to the unavailability of 3D floor data on ZScript and will be
fixed once 3D floors are exported to scripting (still waiting on that PR) fixed once 3D floors are exported to scripting (still waiting on that PR)
## Known bugs that are not this mod's fault
- Pulse gun beams behave oddly when the player is standing on a moving floor.
This is an interpolation quirk in GZDoom and I can probably find some hacky
way to fix it eventually

View file

@ -473,6 +473,7 @@ Class PulseBolt : Actor
} }
void UpdateBeam( PulseBolt parent, Vector3 x ) void UpdateBeam( PulseBolt parent, Vector3 x )
{ {
bRELATIVETOFLOOR = parent.bRELATIVETOFLOOR;
frame = parent.frame; frame = parent.frame;
SetOrigin(parent.Vec3Offset(x.x*beamsize,x.y*beamsize,x.z*beamsize),true); SetOrigin(parent.Vec3Offset(x.x*beamsize,x.y*beamsize,x.z*beamsize),true);
A_SetAngle(parent.angle); A_SetAngle(parent.angle);
@ -513,6 +514,7 @@ Class StarterBolt : PulseBolt
return; return;
} }
Vector3 x, y, z, origin; Vector3 x, y, z, origin;
bRELATIVETOFLOOR = (target.pos.z <= target.floorz); // hack, but kinda works
if ( target.player ) if ( target.player )
{ {
[x, y, z] = dt_Matrix4.GetAxes(target.pitch,target.angle,target.roll); [x, y, z] = dt_Matrix4.GetAxes(target.pitch,target.angle,target.roll);