Skip to content

Commit d839f65

Browse files
committed
Corrected odd Emission getting for AEmitter and PEmitter.
1 parent 4d0789d commit d839f65

File tree

2 files changed

+6
-12
lines changed

2 files changed

+6
-12
lines changed

Source/Entities/AEmitter.cpp

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -105,12 +105,9 @@ int AEmitter::ReadProperty(const std::string_view& propName, Reader& reader) {
105105
StartPropertyList(return Attachable::ReadProperty(propName, reader));
106106

107107
MatchProperty("AddEmission", {
108-
Entity* readerEntity = g_PresetMan.ReadReflectedPreset(reader);
109-
if (Emission* readerAttachable = dynamic_cast<Emission*>(readerEntity)) {
110-
m_EmissionList.push_back(readerAttachable);
111-
} else {
112-
reader.ReportError("Tried to AddAttachable a non-Attachable type!");
113-
}
108+
Emission* emission = new Emission();
109+
reader >> *emission;
110+
m_EmissionList.push_back(emission);
114111
});
115112
MatchProperty("EmissionSound", {
116113
m_EmissionSound = new SoundContainer;

Source/Entities/PEmitter.cpp

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -90,12 +90,9 @@ int PEmitter::ReadProperty(const std::string_view& propName, Reader& reader) {
9090
StartPropertyList(return MOSParticle::ReadProperty(propName, reader));
9191

9292
MatchProperty("AddEmission", {
93-
Entity* readerEntity = g_PresetMan.ReadReflectedPreset(reader);
94-
if (Emission* readerAttachable = dynamic_cast<Emission*>(readerEntity)) {
95-
m_EmissionList.push_back(readerAttachable);
96-
} else {
97-
reader.ReportError("Tried to AddAttachable a non-Attachable type!");
98-
}
93+
Emission* emission = new Emission();
94+
reader >> *emission;
95+
m_EmissionList.push_back(emission);
9996
});
10097
MatchProperty("EmissionSound", { reader >> m_EmissionSound; });
10198
MatchProperty("BurstSound", { reader >> m_BurstSound; });

0 commit comments

Comments
 (0)