Skip to content
Merged
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
19 changes: 15 additions & 4 deletions subt_ign/src/GameLogicPlugin.cc
Original file line number Diff line number Diff line change
Expand Up @@ -1385,6 +1385,8 @@ bool GameLogicPluginPrivate::OnNewArtifact(const subt::msgs::Artifact &_req,
<< " time_sec: " << this->simTime.sec() << "\n"
<< " total_score: " << this->totalScore << std::endl;
this->LogEvent(stream.str());
this->Finish();
return true;
}
else if (!this->ArtifactFromInt(_req.type(), artifactType))
{
Expand Down Expand Up @@ -1432,11 +1434,20 @@ bool GameLogicPluginPrivate::OnNewArtifact(const subt::msgs::Artifact &_req,
return true;
}

if (!this->finished && this->reportCount > this->reportCountLimit)
if (!this->finished && this->reportCount >= this->reportCountLimit)
{
_resp.set_report_status("report limit exceeded");
this->Log() << "report_limit_exceeded" << std::endl;
ignmsg << "Report limit exceed." << std::endl;
_resp.set_report_status("report limit reached");
this->Log() << "report_limit_reached" << std::endl;
ignmsg << "Report limit reached." << std::endl;

std::ostringstream stream;
stream
<< "- event:\n"
<< " type: artifact_report_limit_reached\n"
<< " time_sec: " << this->simTime.sec() << "\n"
<< " total_score: " << this->totalScore << std::endl;
this->LogEvent(stream.str());

this->Finish();
return true;
}
Expand Down