Browse Source

Fixed a nullptr crash on non-full parties.

pull/2/head
atom0s 8 years ago
parent
commit
17d2660ca9
  1. BIN
      Release/Plugins/Servo.dll
  2. 21
      Source/main.cpp

BIN
Release/Plugins/Servo.dll

Binary file not shown.

21
Source/main.cpp

@ -60,13 +60,20 @@ void Servo::formatCommand(std::string* command)
std::stringstream id; std::stringstream id;
id << m_AshitaCore->GetDataManager()->GetTarget()->GetTargetServerId(); id << m_AshitaCore->GetDataManager()->GetTarget()->GetTargetServerId();
*command = StringSub(*command, "[me]", m_AshitaCore->GetDataManager()->GetParty()->GetMemberName(0)); auto p0 = m_AshitaCore->GetDataManager()->GetParty()->GetMemberName(0);
*command = StringSub(*command, "[p0]", m_AshitaCore->GetDataManager()->GetParty()->GetMemberName(0)); auto p1 = m_AshitaCore->GetDataManager()->GetParty()->GetMemberName(1);
*command = StringSub(*command, "[p1]", m_AshitaCore->GetDataManager()->GetParty()->GetMemberName(1)); auto p2 = m_AshitaCore->GetDataManager()->GetParty()->GetMemberName(2);
*command = StringSub(*command, "[p2]", m_AshitaCore->GetDataManager()->GetParty()->GetMemberName(2)); auto p3 = m_AshitaCore->GetDataManager()->GetParty()->GetMemberName(3);
*command = StringSub(*command, "[p3]", m_AshitaCore->GetDataManager()->GetParty()->GetMemberName(3)); auto p4 = m_AshitaCore->GetDataManager()->GetParty()->GetMemberName(4);
*command = StringSub(*command, "[p4]", m_AshitaCore->GetDataManager()->GetParty()->GetMemberName(4)); auto p5 = m_AshitaCore->GetDataManager()->GetParty()->GetMemberName(4);
*command = StringSub(*command, "[p5]", m_AshitaCore->GetDataManager()->GetParty()->GetMemberName(5));
*command = StringSub(*command, "[me]", p0 != nullptr ? p0 : "");
*command = StringSub(*command, "[p0]", p0 != nullptr ? p0 : "");
*command = StringSub(*command, "[p1]", p1 != nullptr ? p1 : "");
*command = StringSub(*command, "[p2]", p2 != nullptr ? p2 : "");
*command = StringSub(*command, "[p3]", p3 != nullptr ? p3 : "");
*command = StringSub(*command, "[p4]", p4 != nullptr ? p4 : "");
*command = StringSub(*command, "[p5]", p5 != nullptr ? p5 : "");
*command = StringSub(*command, "[t]", id.str()); *command = StringSub(*command, "[t]", id.str());
} }

Loading…
Cancel
Save