Skip to content

Commit

Permalink
Corrected odd Emission getting for AEmitter and PEmitter.
Browse files Browse the repository at this point in the history
  • Loading branch information
Bit-Crust committed Nov 20, 2024
1 parent 4d0789d commit d839f65
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 12 deletions.
9 changes: 3 additions & 6 deletions Source/Entities/AEmitter.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -105,12 +105,9 @@ int AEmitter::ReadProperty(const std::string_view& propName, Reader& reader) {
StartPropertyList(return Attachable::ReadProperty(propName, reader));

MatchProperty("AddEmission", {
Entity* readerEntity = g_PresetMan.ReadReflectedPreset(reader);
if (Emission* readerAttachable = dynamic_cast<Emission*>(readerEntity)) {
m_EmissionList.push_back(readerAttachable);
} else {
reader.ReportError("Tried to AddAttachable a non-Attachable type!");
}
Emission* emission = new Emission();
reader >> *emission;
m_EmissionList.push_back(emission);
});
MatchProperty("EmissionSound", {
m_EmissionSound = new SoundContainer;
Expand Down
9 changes: 3 additions & 6 deletions Source/Entities/PEmitter.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -90,12 +90,9 @@ int PEmitter::ReadProperty(const std::string_view& propName, Reader& reader) {
StartPropertyList(return MOSParticle::ReadProperty(propName, reader));

MatchProperty("AddEmission", {
Entity* readerEntity = g_PresetMan.ReadReflectedPreset(reader);
if (Emission* readerAttachable = dynamic_cast<Emission*>(readerEntity)) {
m_EmissionList.push_back(readerAttachable);
} else {
reader.ReportError("Tried to AddAttachable a non-Attachable type!");
}
Emission* emission = new Emission();
reader >> *emission;
m_EmissionList.push_back(emission);
});
MatchProperty("EmissionSound", { reader >> m_EmissionSound; });
MatchProperty("BurstSound", { reader >> m_BurstSound; });
Expand Down

0 comments on commit d839f65

Please sign in to comment.