Skip to content

Commit

Permalink
[10737] Use empty name for non-unique named pets.
Browse files Browse the repository at this point in the history
This let to client select appropriate name by self base at UNIT_CREATED_BY_SPELL data.
  • Loading branch information
VladimirMangos committed Nov 18, 2010
1 parent d38cdfe commit 449e0b4
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 18 deletions.
9 changes: 0 additions & 9 deletions src/game/Pet.cpp
Expand Up @@ -28,15 +28,6 @@
#include "Unit.h"
#include "Util.h"

char const* petTypeSuffix[MAX_PET_TYPE] =
{
"'s Minion", // SUMMON_PET
"'s Pet", // HUNTER_PET
"'s Guardian", // GUARDIAN_PET
"'s Companion", // PROTECTOR_PET
"'s Companion" // MINI_PET
};

Pet::Pet(PetType type) :
Creature(CREATURE_SUBTYPE_PET),
m_resetTalentsCost(0), m_resetTalentsTime(0), m_usedTalentCount(0),
Expand Down
2 changes: 0 additions & 2 deletions src/game/Pet.h
Expand Up @@ -34,8 +34,6 @@ enum PetType
MAX_PET_TYPE = 5
};

extern char const* petTypeSuffix[MAX_PET_TYPE];

#define MAX_PET_STABLES 4

// stored in character_pet.slot
Expand Down
10 changes: 4 additions & 6 deletions src/game/SpellEffects.cpp
Expand Up @@ -4250,9 +4250,7 @@ void Spell::DoSummon(SpellEffectIndex eff_idx)
spawnCreature->SetHealth(spawnCreature->GetMaxHealth());
spawnCreature->SetPower(POWER_MANA, spawnCreature->GetMaxPower(POWER_MANA));

std::string name = m_caster->GetName();
name.append(petTypeSuffix[spawnCreature->getPetType()]);
spawnCreature->SetName( name );
spawnCreature->SetName(""); // generated by client

map->Add((Creature*)spawnCreature);

Expand Down Expand Up @@ -4668,6 +4666,7 @@ void Spell::DoSummonGuardian(SpellEffectIndex eff_idx, uint32 forceFaction)
if (duration > 0)
spawnCreature->SetDuration(duration);

spawnCreature->SetName(""); // generated by client
spawnCreature->SetOwnerGuid(m_caster->GetObjectGuid());
spawnCreature->setPowerType(POWER_MANA);
spawnCreature->SetUInt32Value(UNIT_NPC_FLAGS, spawnCreature->GetCreatureInfo()->npcflag);
Expand Down Expand Up @@ -7073,6 +7072,7 @@ void Spell::DoSummonTotem(SpellEffectIndex eff_idx, uint8 slot_dbc)
if (slot < MAX_TOTEM_SLOT)
m_caster->_AddTotem(TotemSlot(slot),pTotem);

pTotem->SetName(""); // generated by client
pTotem->SetOwner(m_caster);
pTotem->SetTypeBySummonSpell(m_spellInfo); // must be after Create call where m_spells initialized

Expand Down Expand Up @@ -7584,6 +7584,7 @@ void Spell::DoSummonCritter(SpellEffectIndex eff_idx, uint32 forceFaction)
return;
}

critter->SetName(""); // generated by client
critter->SetOwnerGuid(m_caster->GetObjectGuid());
critter->SetCreatorGuid(m_caster->GetObjectGuid());

Expand All @@ -7601,9 +7602,6 @@ void Spell::DoSummonCritter(SpellEffectIndex eff_idx, uint32 forceFaction)
if(duration > 0)
critter->SetDuration(duration);

std::string name = player->GetName();
name.append(petTypeSuffix[critter->getPetType()]);
critter->SetName( name );
player->SetMiniPet(critter);

map->Add((Creature*)critter);
Expand Down
2 changes: 1 addition & 1 deletion src/shared/revision_nr.h
@@ -1,4 +1,4 @@
#ifndef __REVISION_NR_H__
#define __REVISION_NR_H__
#define REVISION_NR "10736"
#define REVISION_NR "10737"
#endif // __REVISION_NR_H__

0 comments on commit 449e0b4

Please sign in to comment.