Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion Core/World/Entities/Definition/EntityFrameTable.cs
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ public class EntityFrameTable
return m_vileHealFrame;
}

public int GetBloodIndex()
public int GetBloodFrameIndex()
{
if (m_bloodIndex != -1)
return m_bloodIndex;
Expand Down
22 changes: 12 additions & 10 deletions Core/World/WorldBase.cs
Original file line number Diff line number Diff line change
Expand Up @@ -3135,13 +3135,13 @@ private void CreateBloodOrPulletPuff(Entity? entity, Vec3D intersect, double ang
return;

bool bulletPuff = entity == null || entity.Definition.Flags.NoBlood() || entity.Flags.Dormant();
EntityDefinition? def;
EntityDefinition? def = null;
if (bulletPuff)
{
def = EntityManager.DefinitionComposer.BulletPuffDefinition;
intersect.Z += Random.NextDiff() * Constants.PuffRandZ;
}
else
else if (entity != null)
{
def = entity!.GetBloodDefinition();
}
Expand Down Expand Up @@ -3186,20 +3186,22 @@ private void SetBloodValues(Entity? entity, Entity blood, int damage, bool rippe

blood.Velocity.Z = 2;

// Doom had the blood states hardcoded. Supercharged bulletride seems to function differing in gz vs dsda.
// The changed the frame for blood that dsda will ignore because of hardcoded states, but work in gz.
if (HasDehacked && entity != null && entity.FrameState.Frame.VanillaIndex != (int)ThingState.BLOOD1)
return;

int offset = 0;
if (damage <= 12 && damage >= 9)
offset = 1;
else if (damage < 9)
offset = 2;

if (offset == 0)
blood.SetRandomizeTicks();
else if (blood.Definition.SpawnState != null)
blood.SetRandomizeTicks();

if (HasDehacked)
{
if (offset > 0)
blood.FrameState.SetFrameIndex(blood, ArchiveCollection.EntityFrameTable.GetBloodFrameIndex() + offset);
return;
}

if (blood.Definition.SpawnState != null)
blood.FrameState.SetFrameIndex(blood, blood.Definition.SpawnState.Value + offset);
}

Expand Down
1 change: 1 addition & 0 deletions RELEASENOTES.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@
- Fix A_Refire not calling noise alert.
- Match Doom behavior in the thing tick function that wouldn't advance the state for zero duration frames and leave them in a -1 loop.
- Fix PNGs with fully transparent pixels loading colors that causes rendering issues when used with texture filtering.
- Fix spawn blood to use hard-coded vanilla frames when dehacked is present.

## Misc:
- Refactor of old Status Bar renderer to data-driven SBARDEF format.
Expand Down
Loading