Skip to content

Commit 98d6987

Browse files
authored
Merge pull request #42 from cortex-command-community/null-activity
Only perform activity actions when activity is running
2 parents bc9580e + 5a80149 commit 98d6987

File tree

2 files changed

+8
-2
lines changed

2 files changed

+8
-2
lines changed

Source/Managers/MovableMan.cpp

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -683,7 +683,10 @@ void MovableMan::AddActor(Actor* actorToAdd) {
683683

684684
void MovableMan::AddItem(HeldDevice* itemToAdd) {
685685
if (itemToAdd) {
686+
RTEAssert(g_ActivityMan.ActivityRunning(), "No activity running, can't add items!");
687+
686688
g_ActivityMan.GetActivity()->ForceSetTeamAsActive(itemToAdd->GetTeam());
689+
687690
itemToAdd->SetAsAddedToMovableMan();
688691
itemToAdd->CorrectAttachableAndWoundPositionsAndRotations();
689692

@@ -706,7 +709,10 @@ void MovableMan::AddItem(HeldDevice* itemToAdd) {
706709

707710
void MovableMan::AddParticle(MovableObject* particleToAdd) {
708711
if (particleToAdd) {
712+
RTEAssert(g_ActivityMan.ActivityRunning(), "No activity running, can't add particles!");
713+
709714
g_ActivityMan.GetActivity()->ForceSetTeamAsActive(particleToAdd->GetTeam());
715+
710716
particleToAdd->SetAsAddedToMovableMan();
711717
if (MOSRotating* particleToAddAsMOSRotating = dynamic_cast<MOSRotating*>(particleToAdd)) {
712718
particleToAddAsMOSRotating->CorrectAttachableAndWoundPositionsAndRotations();

Source/System/DataModule.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -133,9 +133,9 @@ int DataModule::ReadModuleProperties(const std::string& moduleName, const Progre
133133
}
134134

135135
int DataModule::ReadProperty(const std::string_view& propName, Reader& reader) {
136-
StartPropertyList(if (!g_PresetMan.GetEntityPreset(reader)) { reader.ReportError("Could not understand Preset type!"); })
136+
StartPropertyList(if (!g_PresetMan.GetEntityPreset(reader)) { reader.ReportError("Could not understand Preset type!"); });
137137

138-
MatchProperty("ModuleName", { reader >> m_FriendlyName; });
138+
MatchProperty("ModuleName", { reader >> m_FriendlyName; });
139139
MatchProperty("Author", { reader >> m_Author; });
140140
MatchProperty("Description", {
141141
std::string descriptionValue = reader.ReadPropValue();

0 commit comments

Comments
 (0)