Skip to content

Commit

Permalink
[10310] Clarify argument in emote related functions, expecting emote id
Browse files Browse the repository at this point in the history
Signed-off-by: NoFantasy <nofantasy@nf.no>
  • Loading branch information
NoFantasy committed Aug 2, 2010
1 parent 8bd79d6 commit d39c7e5
Show file tree
Hide file tree
Showing 5 changed files with 18 additions and 18 deletions.
6 changes: 3 additions & 3 deletions src/game/ChatHandler.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -556,17 +556,17 @@ void WorldSession::HandleTextEmoteOpcode( WorldPacket & recv_data )
if (!em)
return;

uint32 emote_anim = em->textid;
uint32 emote_id = em->textid;

switch(emote_anim)
switch(emote_id)
{
case EMOTE_STATE_SLEEP:
case EMOTE_STATE_SIT:
case EMOTE_STATE_KNEEL:
case EMOTE_ONESHOT_NONE:
break;
default:
GetPlayer()->HandleEmoteCommand(emote_anim);
GetPlayer()->HandleEmoteCommand(emote_id);
break;
}

Expand Down
18 changes: 9 additions & 9 deletions src/game/Unit.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1726,29 +1726,29 @@ void Unit::DealMeleeDamage(CalcDamageInfo *damageInfo, bool durabilityLoss)
}


void Unit::HandleEmoteCommand(uint32 anim_id)
void Unit::HandleEmoteCommand(uint32 emote_id)
{
WorldPacket data( SMSG_EMOTE, 4 + 8 );
data << uint32(anim_id);
data << uint32(emote_id);
data << uint64(GetGUID());
SendMessageToSet(&data, true);
}

void Unit::HandleEmoteState(uint32 anim_id)
void Unit::HandleEmoteState(uint32 emote_id)
{
SetUInt32Value(UNIT_NPC_EMOTESTATE, anim_id);
SetUInt32Value(UNIT_NPC_EMOTESTATE, emote_id);
}

void Unit::HandleEmote(uint32 anim_id)
void Unit::HandleEmote(uint32 emote_id)
{
if (!anim_id)
if (!emote_id)
HandleEmoteState(0);
else if (EmotesEntry const* emoteEntry = sEmotesStore.LookupEntry(anim_id))
else if (EmotesEntry const* emoteEntry = sEmotesStore.LookupEntry(emote_id))
{
if (emoteEntry->EmoteType) // 1,2 states, 0 command
HandleEmoteState(anim_id);
HandleEmoteState(emote_id);
else
HandleEmoteCommand(anim_id);
HandleEmoteCommand(emote_id);
}
}

Expand Down
6 changes: 3 additions & 3 deletions src/game/Unit.h
Original file line number Diff line number Diff line change
Expand Up @@ -1278,9 +1278,9 @@ class MANGOS_DLL_SPEC Unit : public WorldObject
void ProcDamageAndSpell(Unit *pVictim, uint32 procAttacker, uint32 procVictim, uint32 procEx, uint32 amount, WeaponAttackType attType = BASE_ATTACK, SpellEntry const *procSpell = NULL);
void ProcDamageAndSpellFor( bool isVictim, Unit * pTarget, uint32 procFlag, uint32 procExtra, WeaponAttackType attType, SpellEntry const * procSpell, uint32 damage );

void HandleEmote(uint32 anim_id); // auto-select command/state
void HandleEmoteCommand(uint32 anim_id);
void HandleEmoteState(uint32 anim_id);
void HandleEmote(uint32 emote_id); // auto-select command/state
void HandleEmoteCommand(uint32 emote_id);
void HandleEmoteState(uint32 emote_id);
void AttackerStateUpdate (Unit *pVictim, WeaponAttackType attType = BASE_ATTACK, bool extra = false );

float MeleeMissChanceCalc(const Unit *pVictim, WeaponAttackType attType) const;
Expand Down
4 changes: 2 additions & 2 deletions src/game/debugcmds.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -751,8 +751,8 @@ bool ChatHandler::HandleDebugAnimCommand(const char* args)
if (!*args)
return false;

uint32 anim_id = atoi((char*)args);
m_session->GetPlayer()->HandleEmoteCommand(anim_id);
uint32 emote_id = atoi((char*)args);
m_session->GetPlayer()->HandleEmoteCommand(emote_id);
return true;
}

Expand Down
2 changes: 1 addition & 1 deletion src/shared/revision_nr.h
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#ifndef __REVISION_NR_H__
#define __REVISION_NR_H__
#define REVISION_NR "10309"
#define REVISION_NR "10310"
#endif // __REVISION_NR_H__

0 comments on commit d39c7e5

Please sign in to comment.