Skip to content

Commit

Permalink
Fixed: WOP flood when casting spells using extremely short delays
Browse files Browse the repository at this point in the history
  • Loading branch information
coruja747 committed Jun 29, 2016
1 parent 3066341 commit 4d6d83a
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
3 changes: 2 additions & 1 deletion docs/REVISIONS-56-SERIES.TXT
Original file line number Diff line number Diff line change
Expand Up @@ -109,4 +109,5 @@ Fixed: Popup menu on players returning parsing error when send Party clilocs to
[speakhuman.scp]: Fixed 'train' command returning console error when used on guards NPCs.

29-06-2016, Coruja
Fixed: Attack/Kill command on pets allowing select the pet itself as target, making it attack his owner.
Fixed: Attack/Kill command on pets allowing select the pet itself as target, making it attack his owner.
Fixed: WOP flood when casting spells using extremely short delays.
6 changes: 4 additions & 2 deletions src/graysvr/CCharSpell.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2986,9 +2986,11 @@ int CChar::Spell_CastStart()
INT64 WOPColor = Args.m_VarsLocal.GetKeyNum("WOPColor", true);
INT64 WOPFont = Args.m_VarsLocal.GetKeyNum("WOPFont", true);

// Correct talk mode for spells WOP is TALKMODE_SPELL, but since sphere doesn't have any delay between spell casts this can allow WOP flood on screen.
// So to avoid this problem we must use TALKMODE_SAY, which is not the correct type but with this type the client only show last 3 messages on screen.
if ( pSpellDef->m_sRunes[0] == '.' )
{
Speak((pSpellDef->m_sRunes.GetPtr()) + 1, static_cast<HUE_TYPE>(WOPColor), TALKMODE_SPELL, static_cast<FONT_TYPE>(WOPFont));
Speak((pSpellDef->m_sRunes.GetPtr()) + 1, static_cast<HUE_TYPE>(WOPColor), TALKMODE_SAY, static_cast<FONT_TYPE>(WOPFont));
}
else
{
Expand All @@ -3006,7 +3008,7 @@ int CChar::Spell_CastStart()
if ( len > 0 )
{
pszTemp[len] = 0;
Speak(pszTemp, static_cast<HUE_TYPE>(WOPColor), TALKMODE_SPELL, static_cast<FONT_TYPE>(WOPFont));
Speak(pszTemp, static_cast<HUE_TYPE>(WOPColor), TALKMODE_SAY, static_cast<FONT_TYPE>(WOPFont));
}
}
}
Expand Down

0 comments on commit 4d6d83a

Please sign in to comment.