This commit is contained in:
SecretsOTheP
2013-03-15 03:27:45 -04:00
committed by Derision
parent d76a8bd34a
commit 0bc942f4d5
3 changed files with 113 additions and 81 deletions
+10 -1
View File
@@ -5627,7 +5627,7 @@ bool Merc::Unsuspend(bool setMaxStats) {
if(!mercOwner->IsGrouped())
{
Group *g = new Group(mercOwner);
if(AddMercToGroup(this, g))
if(g && AddMercToGroup(this, g))
{
entity_list.AddGroup(g);
database.SetGroupLeaderName(g->GetID(), mercOwner->GetName());
@@ -5638,6 +5638,15 @@ bool Merc::Unsuspend(bool setMaxStats) {
loaded = true;
}
else
{
if(MERC_DEBUG > 0)
mercOwner->Message(7, "Mercenary failed to join the group - Suspending");
Suspend();
safe_delete(g);
return false;
}
}
else if (AddMercToGroup(this, mercOwner->GetGroup()))
{