Skip to content

Commit

Permalink
[10738] In fact set pet name to empety state redundent.
Browse files Browse the repository at this point in the history
Client work propertly also if used default name from creature template (set in create code).

Signed-off-by: VladimirMangos <vladimir@getmangos.com>
  • Loading branch information
tomrus88 authored and VladimirMangos committed Nov 18, 2010
1 parent 449e0b4 commit a3b1a7c
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
8 changes: 4 additions & 4 deletions src/game/SpellEffects.cpp
Expand Up @@ -4250,7 +4250,7 @@ void Spell::DoSummon(SpellEffectIndex eff_idx)
spawnCreature->SetHealth(spawnCreature->GetMaxHealth());
spawnCreature->SetPower(POWER_MANA, spawnCreature->GetMaxPower(POWER_MANA));

spawnCreature->SetName(""); // generated by client
//spawnCreature->SetName(""); // generated by client

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

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

spawnCreature->SetName(""); // generated by client
//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 @@ -7072,7 +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->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,7 +7584,7 @@ void Spell::DoSummonCritter(SpellEffectIndex eff_idx, uint32 forceFaction)
return;
}

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

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 "10737"
#define REVISION_NR "10738"
#endif // __REVISION_NR_H__

14 comments on commit a3b1a7c

@rsa
Copy link
Contributor

@rsa rsa commented on a3b1a7c Nov 18, 2010

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

can not be torturing this almost dead pets code? it requires a complete rewrite and not pile patches on the patches.

@Forusim
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Indeed rsa. Since we have many pets/guardians in wotlk, like shaman, DK, druid, etc the old code not support them properly with stats etc.

@rsa
Copy link
Contributor

@rsa rsa commented on a3b1a7c Nov 18, 2010

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

is not a suitable place to discuss this problem. especially since I made it for myself long ago decided.

@VladimirMangos
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

How stats related to defender mode pet type support. I think you not understand that development is sollution specific problems step by step with take in look ofc generic picture. And ofc, attempt fix all what see wrong in one step not related to normal development, just show low level understanding of normal clean for team and developers community product development style.

@rsa
Copy link
Contributor

@rsa rsa commented on a3b1a7c Nov 18, 2010

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Step by step development of optimal, when the code was originally developed in the right direction. If this piece of code is fundamentally incorrect and based on the Hacks, the attempt to modify the step will only worsen the situation.
As in this instance - obviously necessary to add PROTECTOR_PET led adding another obviously hacks function GetProtectorPet ()

@VladimirMangos
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

in fact it can be stored in Player field as minipet. But in other cases this is guardian like pet so i not add field, but think about like way.

Not exist "code was originally developed in the right direction". All code is result some discussion and way selection with good and bad sides for each way base at time discussion known data and expected future uses. That in 99% cases at some moment will outdated and conflict with new before unknown directions of product developement.

And rewrites also can be done step by step. It's known way: make problem parts hide in more clear API abstraction, move code for use this API, update hidden parts, remove redundant code, and repeat until see appropriate level quality.

@VladimirMangos
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

in fact it can be stored in Player field as minipet

Clarify: in new field similar minipet field.

@rsa
Copy link
Contributor

@rsa rsa commented on a3b1a7c Nov 19, 2010

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You do not forget that the field UNIT_FIELD_CRITTER (not player field) is not used by mangos, but instead put hack m_miniPetGuid?

@VladimirMangos
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You right i not remember about UNIT_FIELD_CRITTER (in fact first time read about), BUT I not "put hack". I update existed field to ObjectGuid.
Start use UNIT_FIELD_CRITTER field if it related to minipet can be good step but independent from this or later commits. Remember, step by step ;) Tested patch for use this field will welcome.

@rsa
Copy link
Contributor

@rsa rsa commented on a3b1a7c Nov 19, 2010

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

i use this field over 3 month, now by ObjectGuid way. but not in player structure, in unit (creatures also may have critters). need publish clean pacth?

@VladimirMangos
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

hmm, then with related spelleffect changes, Also maybe spell example for minipet for creature owner will be nice.
Yes, will be nice have clean patch or commit reference if it include all changes.

@rsa
Copy link
Contributor

@rsa rsa commented on a3b1a7c Nov 19, 2010

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

effects this type I have not found. in only one sent to me sniff creature was filled field UNIT_FIELD_CRITTER - seller of parrots in Booty Bay. may be from not-DBC spells?

@rsa
Copy link
Contributor

@rsa rsa commented on a3b1a7c Nov 19, 2010

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

for revision 10744:
https://gist.github.com/706597

only changes for use this field.

@VladimirMangos
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

thank you. Added in [10754]. I also allow cast summon spells by any units.

Test by .cast self, and it work fine for creatures.

Please sign in to comment.